【问题标题】:Is it possible to hide from some users some menu's elements while using ASP.NET menu control?是否可以在使用 ASP.NET 菜单控件时向某些用户隐藏某些菜单元素?
【发布时间】:2011-08-12 03:50:03
【问题描述】:

假设我有一个包含所有内容的菜单。但是,我希望某些元素对每个用户都不可见。

感谢您的帮助

【问题讨论】:

    标签: asp.net web-controls


    【解决方案1】:

    您可以将菜单项绑定到站点地图并使用角色属性。您需要在您的 Web.Config 中启用 Security Trimming 才能执行此操作。

    你可以在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找到一个很好的教程

    更多信息请查看:Can I hide/show asp:Menu items based on role?

    【讨论】:

    • @Richard77: :)) 很高兴我能帮上忙。
    猜你喜欢
    • 2011-01-16
    • 2011-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多