我有四个不同的用户角色,每个用户都可以访问某些 页面.如何根据用户访问权限设置条件asp菜单
I have got four different user roles, with each user having access to certain pages. How can I setup a conditional asp menu based on the user access level?
推荐答案像这样(假设您使用的是表单身份验证) villagecoder.wordpress/2008/08/29 /creating-a-role-based-aspnet-menu/ like this (assuming you are using forms authentication) villagecoder.wordpress/2008/08/29/creating-a-role-based-aspnet-menu/
通常,菜单链接到URL.所以.. 在您的网络配置文件中有这样的 Usually the menu links to an URL. So.. In your web config file have like this <system.web> <authorization> <deny users="?" /> </authorization> </system.web> <location path="Default2.aspx"> <system.web> <authorization> <allow users="Jack" /> <deny users="*" /> </authorization> </system.web> </location>
因此,default2.aspx仅允许分配的用户使用.可以使用逗号分隔的用户. 有关更多详细信息,请参见此链接.. www.asp/security/tutorials/user-based-authorization-cs [^ ] Microsoft文档 msdn.microsoft/en-us/library/wce3kxhd.aspx [ ^ ]
so the default2.aspx will be only allowed for the users assigned. Can use comma separated users. For more detail refer this link.. www.asp/security/tutorials/user-based-authorization-cs[^] the Microsoft documentation msdn.microsoft/en-us/library/wce3kxhd.aspx[^]
ASP.NET菜单和SiteMap安全性修剪 请留下您的评论帮助与否. ASP.NET Menu and SiteMap Security Trimming Please leave you comment helps or not.