I have the attached code which is attached to the onClick event of a linkbutton.
Each linkbutton is beside a label. That label holds some text that is put into the session variable.
<asp:LinkButton ID="lnkEmailLink" runat="server" OnClick="lnkEmailLink_Clic
k" Text="Email" />
<asp:Label ID="lblEmailUser" runat="server" Text="jcoulson" Visible="false" />
This works fine if the page only has one of these linkbutton/label combinations. If there are more, I will need to have a different click function for each label. What I need is one function that can tell which label is being used. This is where it gets tricky for me. The script needs to know which label to get its session variable data from.
Ideas? I keep trying things, but they don't work out. I'm having a hard time getting this one rolling.
protected void lnkEmailLink_Click(object sender, EventArgs e)
// Set a session variable equal to the text of the hidden label.
Session["emailUser"] = Server.HtmlEncode(lblEmailUser.Text);
// Go to the form page.