0
我有一个包含4-5个aspx页面的Admin文件夹。我希望只有角色=“admin”的用户才能查看这些文件。 web.config中需要什么设置?管理员文件夹权限,仅限角色= admin
我有一个包含4-5个aspx页面的Admin文件夹。我希望只有角色=“admin”的用户才能查看这些文件。 web.config中需要什么设置?管理员文件夹权限,仅限角色= admin
在您的web.config文件的授权区域中添加一个位置标识符。
<location path="Admin">
<system.web>
<authorization>
<allow roles="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
这是非常基本的形式认证使用。也许你应该看看一些使用表单身份验证的教程。
Google表单认证: http://www.15seconds.com/issue/020220.htm