Last post Jul 08, 2017 10:22 AM by Zlalini
Jul 08, 2017 08:09 AM|Zlalini|LINK
I have a grid view which has a column called name and a column which consists of link buttons which hyperlinks to a new form. Now I want this name parameter in a label which is in the new form. I'm using Sessions to do that but the problem is, every
time, only the first row get's selected. But I want the name from the row corresponding to that of the hyperlink button which the user clicks on.
Jul 08, 2017 10:01 AM|hkholakiya|LINK
You can do this in many way but one simple way i am putting here:
<asp:TemplateField HeaderText="ID" HeaderStyle-Wrap="false">
<asp:LinkButton ID="lnkRequestID" runat="server" CommandArgument='<%# Eval("RequestID") %>'
OnCommand="lnkRequestID_Click" Text='<%# Eval("RequestID") %>' on> </asp:LinkButton>
protected void lnkRequestID_Click(object sender, CommandEventArgs e)
Session["ABC"] = gv.SelectedDataKey.Value;
Hope it helps you. If yes please mark as answer.
Jul 08, 2017 10:22 AM|Zlalini|LINK
Thanks a ton!