V
VB Programmer
I have 3 roles in my ASP.NET webapp: Admin, Manager & User (higheset to
lowest)
When the user logs in I want 1 or more custom menues to appear:
Admin: Show menu1, menu2, menu3
Manager: Show menu2, menu3
User: Show menu3
What is the best way to do this? In the past I've used 3 panels which I
turned invisible based on the role in the Form_Load event. But, I know
there must be a better way to show the correct menus based on the role
assigned to the user.
I experimented a bit with the LoginView control, but couldn't get it to show
up right, for example...
<asp:RoleGroup Roles="Admin">
<ContentTemplate>
This only shows up for the ADMIN
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="Admin,Manager">
<ContentTemplate>
This only shows up for the MGR
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="Admin,Manager,User">
<ContentTemplate>
This only shows up for the USER
</ContentTemplate>
</asp:RoleGroup>
When logged in as an ADMIN I would expect all 3 to show up but only the
ADMIN one shows up.
Any ideas?
Thanks in advance!
lowest)
When the user logs in I want 1 or more custom menues to appear:
Admin: Show menu1, menu2, menu3
Manager: Show menu2, menu3
User: Show menu3
What is the best way to do this? In the past I've used 3 panels which I
turned invisible based on the role in the Form_Load event. But, I know
there must be a better way to show the correct menus based on the role
assigned to the user.
I experimented a bit with the LoginView control, but couldn't get it to show
up right, for example...
<asp:RoleGroup Roles="Admin">
<ContentTemplate>
This only shows up for the ADMIN
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="Admin,Manager">
<ContentTemplate>
This only shows up for the MGR
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="Admin,Manager,User">
<ContentTemplate>
This only shows up for the USER
</ContentTemplate>
</asp:RoleGroup>
When logged in as an ADMIN I would expect all 3 to show up but only the
ADMIN one shows up.
Any ideas?
Thanks in advance!