关于IHttpModule我写了一个http模块,用来验证用户登陆,在web.config里注册后,又修改了下面的2项:
  <authentication mode="None" /> 
    <authorization>              
<deny  users="?" /> <!-- 允许所有用户 -->        
    </authorization>最后我想把login.aspx页面设置为匿名就可以访问,却怎么也配置不出来,配置出来的是登陆login.aspx页面也受http模块的影响要输入用户名和密码?怎么配置才可以把login.aspx设置为匿名就可以访问啊?

解决方案 »

  1.   

    looks weird, but seehttp://support.microsoft.com/default.aspx?scid=kb;EN-US;Q316871
      

  2.   

    应该是用* 号吧。。<configuration>
    <system.web>
    <authentication mode="Forms" >
    <forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20" >
    </forms>
    </authentication>
    <!-- This section denies access to all files in this application except for those that you have not explicitly specified by using another setting. -->
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    <!-- This section gives the unauthenticated user access to the Default1.aspx page only. It is located in the same folder as this configuration file. -->
    <location path="default1.aspx">
    <system.web>
    <authorization>
    <allow users ="*" />
    </authorization>
    </system.web>
    </location>
    <!-- This section gives the unauthenticated user access to all of the files that are stored in the Subdir1 folder.  -->
    <location path="subdir1">
    <system.web>
    <authorization>
    <allow users ="*" />
    </authorization>
    </system.web>
    </location>
    </configuration>
      

  3.   

    如果在根目录下的web.config设置为<allow users ="?" />,那该目录下的所有文件及文件加内的文件均不能够匿名访问了.
      

  4.   

    csdn真的不行了,问这么个问题都没人回答!那么长时间!