Reputation: 11
<asp:GridView ID="gvstudent" AutoGenerateColumns="false" runat="server" OnRowCommand="gvstudent_RowCommand">
<Columns>
<asp:BoundField DataField="FName" HeaderText="Name" />
<asp:BoundField DataField="LName" HeaderText="Surname" />
<asp:BoundField DataField="Email" HeaderText="Email" />
<asp:BoundField DataField="Technology" HeaderText="Technology" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lbview" CommandName="cmdView" CommandArgument='<%#Eval("ID") %>' runat="server">View</asp:LinkButton>
<asp:LinkButton ID="lbDelete" CommandName="cmdDelete" CommandArgument='<%#Eval("ID") %>' runat="server">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Upvotes: 1
Views: 3272
Reputation: 5601
The lbview link button is in an item template, so its ID changes when the gridview data binds, it would be something like gvstudent_ctl00_lbview in the end
Consider using the client-API of the MPE: $find("<%=theModalPopupExtenderID.ClientID%>").show() and call that from the client click o nthe lbview. And, do not forget to cancel the postback.
Or, take a look here for a similar scenario that uses JS: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window.
Upvotes: 2