I have a Panel in my Master page:
<asp:Panel ID="pnlSettings" runat="server" >
[<asp:LinkButton ID="btnSettings" runat="server" Text="Settings" OnClick="btnSettings_Click" />]
I want it to be invisible for certain users. I tried it in my Page's Page_Init():
Panel pnlSettings = ((TPSMasterPage)Master).GetControl((TPSMasterPage)Master, "pnlSettings") as Panel;
if (pnlSettings != null)
pnlSettings.Visible = false;
This code is executed, but the Panel is still visible.
I tried to move it to Master page's Page_Load(), with the same result. What am I doing wrong?