Al

Al

  • NA
  • 30
  • 6.2k

How to reference to a LinkButton inside Gridview in asp.net

Apr 26 2020 4:26 PM
Hi, I am using Modal popup extender to show a panel once I click on Button1 control as seen below. The code works fine.
However, I instead of using Button1 control as a target ( TargetControlID="Button1" ) , I want to use another control inside gridview , LbnInternDetail to show detail once a user
click on it.
My question, how can I refrence <asp:LinkButton button which is located inside a gridview
TargetControlID="GvName.Container(" XXXX ") // not sure and do not know how
Please help
 
<asp:Button ID="Button1" runat="server" Text="fill form" />
<%-- code from 89 til 100 is modal popup--%>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
CancelControlID="btnCancel"
TargetControlID="Button1"
PopupControlID="Panel1">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="Popup" align="center" style = "display:none">
<iframe style=" width: 350px; height: 200px;" id="irm1" src="changePwd.aspx" runat="server"></iframe>
<br/>
<asp:Button ID="Button2" runat="server" Text="Close" />
</asp:Panel>
<asp:TemplateField HeaderText="Name " InsertVisible="false" SortExpression="internName">
<ItemStyle />
<ItemTemplate>
<asp:LinkButton ID="LbnInternDetail"
OnClick="InternDetail"
Text='<%# DataBinder.Eval(Container.DataItem,"internName") %>'
CommandArgument='<%# Eval("internId") %>'
CommandName="select"
ForeColor="#8C4510" runat="server"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>


Al
 


Answers (1)