Set value of variable upon hyperlink click - ASP.net
Hi guys, I've currently got a listview on a asp.net webpage that displays "cottage" records from an access database. The name of each cottage is displayed as a hyperlink so when clicked brings you to another webpage. Below is the asp code for the name of the cottage.
Code:
<li style="">Name:
<asp:Hyperlink ID="Cottage_NameLabel" NavigateURL="~/Cottage.aspx" runat="server"
Text='<%# Eval("Cottage_Name") %>' />
<br />
This works perfectly fine when selecting a hyperlink. What I want the system to do is to set the value of a publically declared variable (set in a module) to the "Cottage_Name" of the selected hyperlink. So say if i clicked on a hyperlink that said "cottage1", the public variable is set to cottage1 and then the navigate url opens the next webpage.
Would really appreciate it if anyone could help me do this!
Thankyou:D
Re: Set value of variable upon hyperlink click - ASP.net
EDIT: I'm trying to set the variable so that when the page (that is loaded when the hyperlink is selected) is brought up, i can use an sql query that selects a record where the name of the cottage is equal to the value of the variable i am trying to set and then display the result on the page. Sorry if i haven't made it very clear, i'm very new to ASP web development.
Re: Set value of variable upon hyperlink click - ASP.net
Have a look into Session variables