The list of items (hyperlinks) is shown in a listview retrieved by a query. And on clicking, it redirects to another page where i need to fetch the data of that item by using its name, which is the text that item(hyperlink). How do i access the text property (name) of the item that was clicked on?
Share
If you are indeed clicking a hyperlink which redirects to another page, you cannot get that information.
The only way to do it would be to include the information you need in a querystring, and parse the querystring on the next page.
However, if you are posting the form to another page, and your hyperlink is actually an input, your information will be available in the post data.
If your hyperlink is actually a server control, there are many possibilities.
It might help to see some code.
OK, if this is your code:
There are a few things you can do. First, you can change your
asp:Hyperlinkto anasp:LinkButtonadd a click event and remove theNavigateUrlproperty:Now, use the event handler to do what you need:
Then, in the
Page_Loadevent of your landing page, you can do this: