In our master page, we are trying to hide the link to Admin screen on page load. Here is the code:
<div class="footer" id="divAdmin" Visible="False">
<ul>
<li><a href="~/admin.aspx">Administration Page</a></li>
</ul>
</div>
After the user successfully logs in, show the link if the user is an admin. An admin has userRole of 1 assigned to it.
I am trying to accomplish this with code below on page_load() event:
If Session("UserRole") = 1 Then
divAdmin.Visible = True
End If
I can't get beyond the error the following error:
Error 'divAdmin' is not declared. It may be inaccessible due to its protection level.
Any ideas how to fix this?