Let's say I have a menu that contains everything. But, I want some elements not to be visible to every user.
Thanks开发者_运维知识库 for helping
You can bind the menu items to a site map and use the roles attribute. You will need to enable Security Trimming in your Web.Config to do this.
You can find a nice tutorial at http://weblogs.asp.net/jgalloway/archive/2008/01/26/asp-net-menu-and-sitemap-security-trimming-plus-a-trick-for-when-your-menu-and-security-don-t-match-up.aspx
For more information, please check: Can I hide/show asp:Menu items based on role?
精彩评论