Home All Groups Group Topic Archive Search About
Author
18 Jul 2005 1:30 PM
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

Author
18 Jul 2005 6:35 PM
Mythran
Show quote Hide quote
"Pieter" <pauc***@webmail.co.za> wrote in message
news:dbgau4$c37$1@ctb-nnrp2.saix.net...
> 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