有只相当于标准的Web窗体(不MVC)的.NET的authorizeattribute [英] is there an authorizeattribute equivalent to just standard web forms (not MVC) for .net
本文介绍了有只相当于标准的Web窗体(不MVC)的.NET的authorizeattribute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的工作将使用的窗口角色提供一个项目,我想限制的功能,某些AD组。
I'm working on a project that will use windows role providers and I want to limit functionality to certain AD groups.
使用MVC,我可以用一个AuthorizeAttribute我上面的操作方法和相应的重定向。是否有类似的东西我可以为一个标准的Web窗体应用程序(.NET 3.5),这样做不使用MVC?
With MVC, I could use an AuthorizeAttribute above my action methods and redirect accordingly. Is there something similar I can do for a standard web forms application (.NET 3.5) that doesn't use MVC?
请指教,
感谢
推荐答案
您可以设置在web.config中的授权元素。
You can set this up in web.config with the authorization element.
<configuration>
<system.web>
<authorization>
<allow roles="domainname\Managers" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
基本上域组被翻译成的角色时使用的&LT;身份验证模式=窗口/&GT;
。
您可以阅读更多关于它在MSDN
这篇关于有只相当于标准的Web窗体(不MVC)的.NET的authorizeattribute的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文