P
Peter
Hi
I have the following GridView with a LinkButton in a TemplateField,
<asp:GridView ID="ServersGrid" runat="server">
<Columns>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:LinkButton ID="lbDetails" runat="server" onfocus="this.blur()" Text="Details"
CssClass="cntltext" Width="70" OnCommand="LinkButtonClick" CommandName="Details"
CommandArgument='<%#Eval("Name") %>' Visible="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
I would like to change the Visible state in my Page_load code behind depending on some conditions as below but cannot locate the
context name
lbDetails.Visible = true;
I also tried to use Page.FindControl("lbDetails") but returns null as well.
Can someone let me know why the name lbDetails cannot be located within a TemplateField in a GridView and what's the correct way of
referencing the control ?
Thanks
Peter
I have the following GridView with a LinkButton in a TemplateField,
<asp:GridView ID="ServersGrid" runat="server">
<Columns>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:LinkButton ID="lbDetails" runat="server" onfocus="this.blur()" Text="Details"
CssClass="cntltext" Width="70" OnCommand="LinkButtonClick" CommandName="Details"
CommandArgument='<%#Eval("Name") %>' Visible="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
I would like to change the Visible state in my Page_load code behind depending on some conditions as below but cannot locate the
context name
lbDetails.Visible = true;
I also tried to use Page.FindControl("lbDetails") but returns null as well.
Can someone let me know why the name lbDetails cannot be located within a TemplateField in a GridView and what's the correct way of
referencing the control ?
Thanks
Peter