return parameter

P

Pieter

Hi

I want to know the following. I am using ASP.NET and I am (dynamically)
generating a list of hyperlinks from a database. When the user clicks one
of these links it should load an aspx page, but all the links should load
the same aspx page since it will be similar for all of them. What I now
need to know is which link was clicked?

I know it is possible to do something like this
http://www.somewhere.com/info/moreInfo.aspx?no23
In other words I want to append a number to each link and then when
moreInfo.aspx is requested I want to read the no23 item from the database
and regenerate the page with some new image and sumary of that item etc.

How do I acomplish this in VB.NET?
I'm sure its simple to do, I just don't know what this technique is called.

Thanks
Pieter
 
M

Mythran

Pieter said:
Hi

I want to know the following. I am using ASP.NET and I am (dynamically)
generating a list of hyperlinks from a database. When the user clicks one
of these links it should load an aspx page, but all the links should load
the same aspx page since it will be similar for all of them. What I now
need to know is which link was clicked?

I know it is possible to do something like this
http://www.somewhere.com/info/moreInfo.aspx?no23
In other words I want to append a number to each link and then when
moreInfo.aspx is requested I want to read the no23 item from the database
and regenerate the page with some new image and sumary of that item etc.

How do I acomplish this in VB.NET?
I'm sure its simple to do, I just don't know what this technique is
called.

Thanks
Pieter

You want to create a hyperlink that sets a value in the QueryString?

Dim lnk As HyperLink
....

lnk.NavigateUrl = "http://www.somewhere.com/info/moreInfo.aspx?no=23"


In your moreInfo.aspx page, Page_Load (or somewhere else that occurs after
Page_Load event fires), query the value of "no" by using
Request.QueryString...which I believe is a NameValueCollectionBase derived
object.

HTH,
Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top