c# - Click event for ItemTemplate inside asp:GridView -
i have gridview following markup:
<asp:gridview id="gdvresxkeyvalue" runat="server" width="100%" > <columns> <asp:templatefield> <itemtemplate> <asp:image id="imgeditresxvalue" cssclass="sfedit" runat="server" imageurl="~/administrator/templates/default/images/imgedit.png" /> </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
i need have handler image click event. there easier way so?
you can use image button instead of image. try code.
<asp:gridview id="gdvresxkeyvalue" runat="server" width="100%" > <columns> <asp:templatefield> <itemtemplate> <asp:imagebutton id="imgeditresxvalue" cssclass="sfedit" runat="server" imageurl="~/administrator/templates/default/images/imgedit.png" onclick="youreventname" /> </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
you need specify server side event name here.
Comments
Post a Comment