Hi,i have a web user control called StudentsPanel in my master page.I have palced it under the login view as shown below
<asp:LoginView ID="LoginView1" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="Students">
<ContentTemplate>
<uc1:studentPanel runat="server" ID="students_control" />
</ContentTemplate>
</asp:RoleGroup>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
I need to access the control in my aspx page such that i can disable it on page load.I have tried using the code below but am getting null results.Please someone guide me on this,Below is the code i am using but keeps getting null
LoginView control;
Page page = (Page)this.Page;
MasterPage master = (MasterPage)page.Master;
control= (LoginView)master.FindControl("students_control");
if (control!= null)
{
Label1.Text = "found";
}
Mark as answer if satisfied