最近的一个项目中要在web.config中加入权限控制,我查了相关的一些文章并照做,但是好像不管用。
具体的web.config如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation defaultLanguage="c#" debug="true" />
    <customErrors mode="RemoteOnly" defaultRedirect="errorPage.htm" />
    <authentication mode="Forms">
      <forms name=".ASPXFORMSAUTH" loginUrl="Login.aspx" protection="All" path="/" />
    </authentication>
    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
  </system.web>
  <location path="Default.aspx" allowOverride="true">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="errorPage.htm" allowOverride="true">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
</configuration>要求是:未登录的用户只能查看Defalut.aspx和errorPage.htm,如果要查看其他页面要先登录。
请各位高手帮我看看。