c# - getting text of particular control on rowcommand event -


i want take text of linkbutton in rowcommand event.

i clicking on linkbutton , according text bound it, want futher logic.

on rowdatabound have binded text link button depending upon values in database.

now on rowcommand, want check if text of linkbutton "make active" further logic , else further logic.

i tried make as:

protected sub grdmovielst_rowcommand(byval sender object, byval e system.web.ui.webcontrols.gridviewcommandeventargs) handles grdmovielst.rowcommand             if e.commandname = "activecheck"                 dim gvrow gridviewrow = grdmovielst.rows(convert.toint32(e.commandargument))                 if gvrow.findcontrol("lbactivecheck").text /*here text property not comming             end if end sub 

note: code in c# fine me.

gvrow.findcontrol("lbactivecheck").text not giving me text of linkbutton. want text of link button of particular row.

please me.

aspx link button:

<itemtemplate> <asp:linkbutton id="linkbutton1" runat="server" causesvalidation="false" commandname="edit"                                                     text="edit"></asp:linkbutton>  | <asp:linkbutton id="lbactivecheck" runat="server"   commandname="activecheck"></asp:linkbutton> </itemtemplate> 

help in c# welcome.

try this

<itemtemplate> <asp:linkbutton id="linkbutton1" runat="server" causesvalidation="false" commandname="edit"                                                     text="edit"></asp:linkbutton>  | <asp:linkbutton id="lbactivecheck" runat="server" commandargument='<%# container.dataitemindex %>'  commandname="activecheck"></asp:linkbutton> </itemtemplate> 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -