Am I able to hide certain menu items in an asp:Menu
control based on role?
<asp:Menu ID="mTopMenu" runat="server" Orientation="Horizontal" />
<Items>
<asp:MenuItem Text="File">
<asp:MenuItem Text="New Project" />
<asp:MenuItem Text="Release Template" NavigateUrl="~/Release/ReleaseTemplate.aspx" />
<asp:MenuItem Text="Release Schedule" NavigateUrl="~/Release/ReleaseSchedule.aspx" />
<asp:MenuItem Text="Roles" NavigateUrl="~/Admin/AdminRoles.aspx" />
</asp:MenuItem>
</Items>
</asp:Menu>
How can I make one of these items visible to only users in the Admin role? I am using asp.net role provider.
See Question&Answers more detail:os