Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2013, 05:09 AM
Authorized User
 
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
Default reload the page with dyanamic content based on user link click

I am having a listview on a page displaying title of articles[news].
  1. I want to display by default the top news[along with full article] in the adjoining section.
  2. Further i want to update the adjoining section[one with full description] based on user link click in the title only section.

I first thought of implementing the objective via the same method as described on page-464 [customizing the detailsview & handling its events] but it has the dropdownlist items bound to db whereas i am not having dropdownlist so cant bind.

Can any please guide me to relevant code or implementation or how shall i proceed.

Will be a great help. Thanks.
 
Old August 15th, 2013, 02:02 PM
Authorized User
 
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
Default

Hi ok are there any suggestions how can i open a new page based on link click and fetch data based on the link clicked previously ?? [Just like blogs] Thanks
 
Old August 15th, 2013, 02:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you explain what it is you're trying to accomplish? I don't understand what you want which makes it impossible to suggest something. Also, why doesn't the example in the book work for you?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 15th, 2013, 02:32 PM
Authorized User
 
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
Default

hello Imar actually i have gone through the book and am currently eperimenting/learning by making demo projects.

Here is what i have found to be a solution just now:

I want a link which is dynamically generated and points to another page where its[link's] value is used to retrieve data from db.

Quote:
<asp:Hyperlink runat= "server" Text='<%# DataBinder.Eval(Container.DataItem,"Results")%>' NavigateUrl='<%# "Testpage2.aspx?id=" + DataBinder.Eval (Container.DataItem,"ID")%>' ID="Link2" />
But also learnt that it's unsafe [subject to injections.]

Please please please, just spend few minutes of your precious time to point me any direction to go.
 
Old August 15th, 2013, 02:34 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> Please please please, just spend few minutes of your precious time to point me any direction to go.

Would love to, if I knew what help you needed.

The example you posted should work. What;s wrong with it? Why doesn't it work or why would it be unsafe?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 15th, 2013, 02:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

BTW: Is Exercise 3 of Chapter 14 what you're looking for?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 15th, 2013, 02:44 PM
Authorized User
 
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
Default

sir at first i tried to base out mine problems solution on the try out in chapter 13 [page 464] customizing the details view and handling its events where you have shown how to bind db to dropdown list

but then i realised a better solution would be to load a new page with the id of the dynamic link.

1) mine page is having listview [for news titles/headings]
2) i want to open a new page based on the link click[for news details]
3) in the newly opened page i want to fill the listview item template with the news details

problem:

how to open a new page based on link click and use the id of the link to fetch data

-------------------
edit:

the other user probably more experienced says it's unsafe in comments here :http://stackoverflow.com/a/9606848/1936980

the answer i found : http://stackoverflow.com/a/9636024/1936980

if you have posted any blog or article to tackle any similiar issue would be very helpful

Last edited by 07Raghav; August 15th, 2013 at 02:54 PM..
 
Old August 15th, 2013, 02:58 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you see the exercise I referred to? It explains exactly how to do it.

That solution is safe as the ID is passed from page to page and then converted into an integer before it's used.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 15th, 2013, 03:27 PM
Authorized User
 
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
Default

Thanks for your help sir, will look into it. Please also do consider writing books on more subjects.. like ajax, jquery or db.
 
Old August 15th, 2013, 03:45 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> Please also do consider writing books on more subjects.. like ajax, jquery or db.

If only there were 36 hours in a day ;-)

I hope to have addressed these topics with dedicated chapters in the book....

Cheers.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
reload the page with dyanamic content based on user link click 07Raghav BOOK: Professional ASP.NET 4 : in C# and VB 0 August 14th, 2013 11:02 PM
Replace Content based on button click Ciupaz ASP.NET 4 General Discussion 2 February 14th, 2012 04:22 PM
How to Change the page content Per User bex ASP.NET 2.0 Professional 9 January 16th, 2009 03:40 PM
Reload page Tooltip not work - Reload xslt file? ismailc XSLT 10 January 22nd, 2008 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.