 |
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
|
|
|
|
|

August 15th, 2013, 05:09 AM
|
|
Authorized User
|
|
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
|
|
reload the page with dyanamic content based on user link click
I am having a listview on a page displaying title of articles[news].
- I want to display by default the top news[along with full article] in the adjoining section.
- 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.
|
|

August 15th, 2013, 02:02 PM
|
|
Authorized User
|
|
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
|
|
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
|
|

August 15th, 2013, 02:26 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

August 15th, 2013, 02:32 PM
|
|
Authorized User
|
|
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
|
|
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.
|
|

August 15th, 2013, 02:34 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> 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
|
|

August 15th, 2013, 02:35 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
BTW: Is Exercise 3 of Chapter 14 what you're looking for?
Imar
|
|

August 15th, 2013, 02:44 PM
|
|
Authorized User
|
|
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
|
|
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..
|
|

August 15th, 2013, 02:58 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

August 15th, 2013, 03:27 PM
|
|
Authorized User
|
|
Join Date: Nov 2012
Posts: 40
Thanks: 8
Thanked 5 Times in 4 Posts
|
|
Thanks for your help sir, will look into it. Please also do consider writing books on more subjects.. like ajax, jquery or db.
|
|

August 15th, 2013, 03:45 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> 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
|
|
 |
|