- Joined
- Mar 23, 2011
- Messages
- 1
- Reaction score
- 0
I have the following code in Page.aspx in a gridview wich is tied to a database:
<asp:TemplateField
<ItemTemplate>
<asp:LinkButton CommandName="Select" Text="More" Runat="Server" ID="lbMore" Visible="false" >
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
In the Page.aspx.cs i want that when a record is selected the linkbutton lbMore to change the visible proprety to true.
I tried the following but it doesn't work:
protected void gvDetails_SelectedIndexChanged(object sender, EventArgs e)
LinkButton linkButton = (LinkButton)FindControl("lbMore");
linkButton.Visible = true;
I also tried:
LinkButton linkButton = (LinkButton)gvDetails.FindControl("lbMore");
linkButton.Visible = true;
If someone could help me i'd be really greatfully.
<asp:TemplateField
<ItemTemplate>
<asp:LinkButton CommandName="Select" Text="More" Runat="Server" ID="lbMore" Visible="false" >
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
In the Page.aspx.cs i want that when a record is selected the linkbutton lbMore to change the visible proprety to true.
I tried the following but it doesn't work:
protected void gvDetails_SelectedIndexChanged(object sender, EventArgs e)
LinkButton linkButton = (LinkButton)FindControl("lbMore");
linkButton.Visible = true;
I also tried:
LinkButton linkButton = (LinkButton)gvDetails.FindControl("lbMore");
linkButton.Visible = true;
If someone could help me i'd be really greatfully.