I need to send a value to Link_Click
(which is a method) by clicking on this link :
<asp:HyperLink ID="TheLink" runat="server" Text='<%# Eval("ID") %>' onclick="Link_Click"></asp:HyperLink>
the Value is: Eval("name")
I need to send a value to Link_Click
(which is a method) by clicking on this link :
<asp:HyperLink ID="TheLink" runat="server" Text='<%# Eval("ID") %>' onclick="Link_Click"></asp:HyperLink>
the Value is: Eval("name")
onclick is a client-side javascript event handler, so you can do it this way:
onclick="<%= "Link_Click(" + Eval("name") + ")" %>
Otherwise, HyperLink navigates to another page, and you need to add the NavigateUrl property to a value like:
NavigateUrl="Some.aspx?name=<%# Eval("name") %>"
if that will work, but I think you need to do it as:
NavigateUrl="<%= "Some.aspx?name=" + Eval("name").ToString() %>"