Admin文件夹的权限,仅适用于role = admin

时间:2010-06-13 07:08:55

标签: asp.net authorization

我有一个包含4-5个aspx页面的Admin文件夹。我想只有具有role =“admin”的用户才能查看这些文件。我需要在web.config中进行哪些设置?

1 个答案:

答案 0 :(得分:0)

在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

相关问题