日期:2014-05-17  浏览次数:20455 次

.net中webconfig配置权限问题
<authentication mode="Forms">
  <forms name="aaa" loginUrl="Login.aspx"/>
  </authentication>
  <authorization>
  <allow users="*"/>
  </authorization>
  <!--
  如果在执行请求的过程中出现未处理的错误,
  则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
  开发人员通过该节可以配置
  要显示的 html 错误页
  以代替错误堆栈跟踪。

  <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
  <error statusCode="403" redirect="NoAccess.htm" />
  <error statusCode="404" redirect="FileNotFound.htm" />
  </customErrors>
  -->
  </system.web>
  <location path="Admin/Admin_Login.aspx">
  <system.web>
  <authorization>
  <deny users="?"/>
  </authorization>
  </system.web>
  </location>


不知道为什么不起作用?

------解决方案--------------------
<authentication mode="Forms">
<forms name="jack" loginUrl="login.aspx" defaultUrl="Default.aspx">
</forms>
</authentication>
<authorization >
<allow users="jack"/>
<deny users="?"/>

</authorization>