开发者

Is it possible to hide from some users some menu's elements while using ASP.NET menu control?

开发者 https://www.devze.com 2023-02-28 17:50 出处:网络
Let\'s say I have a menu that contains everything. But, I want some elements not to be visible to every user.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消