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

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -