Próbuję przekazać wartość CustomerID dla kodu behind, z mojego elementu LinkButton w formancie gridview. Próbowałem rozwiązania sugerowanego here, ale to nie działa.Przekazywanie wartości identyfikatora do zdarzenia po stronie serwera LinkButton w kontrolce gridview
Mój kod GridView jest:
<asp:TemplateField HeaderText="Last Name, First Name">
<ItemTemplate>
<asp:LinkButton OnClick="EditCustomer" id="lbtnCustomerName" CommandName="CustomerName" Visible="true" runat="server" ToolTip="Click to edit customer."><%# DataBinder.Eval(Container.DataItem, "custLastName") + ", " + DataBinder.Eval(Container.DataItem, "custFirstName" + ", " + DataBinder.Eval(Container.DataItem, "custID")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
protected void EditCustomer(Object sender, EventArgs e)
{
}
Jak mogę uzyskać wartość custid w przypadku EditCustomer?
nie byłoby po prostu 'sender.id'? –