This is my link button:-
<asp:LinkButton ID="lnk1" Text="Set as Default" runat="server" Visible="false" OnClick="lnk1_OnClick"></asp:LinkButton>
In Code Behind I am simply making it visible
lnk1.Visible = true;
I have checked the IDs over n over..whats wrong ? Intellisense wont detect it either..I am doing something really silly..just cant figure what it is ..help!
I even restarted Visual Studio..still same error
Is the contol part of another control template? E.G. part of a repeaters ItemTemplate etc?
Update:
Since OP has said it’s part of a repeaters ItemTemplate, just thought I’d explain what to do (Even though OP has sorted it)
You need to call FindControl on the Repeater, or Controls.OfType() depending on the situation, to get the control.
ASP:
C#
What I’ll often do for commonly used controls (though wether it’s a good idea or not I’m sure someone will now let me know), is create a member which executes this code.