web.config验证访问页面当前用户是否有效

项目遇到访问页面,用户失效问题的解决办法:     

<!--
            通过 <authentication> 节可以配置 ASP.NET 用来
            识别进入用户的
            安全身份验证模式。
        -->

<authentication mode="Forms">
          <forms cookieless="UseCookies" loginUrl="default.aspx" timeout="1440" domain="liuxuetown.com" />
      </authentication>
      <authorization>
          <deny users="?"/>
      </authorization>

    <location path="Register.aspx">
        <system.web>
            <authorization>
                <allow users="?"/>
            </authorization>
        </system.web>
    </location>
    <location path="LoginHttpHandler.axd">
        <system.web>
            <authorization>
                <allow users="?"/>
            </authorization>
        </system.web>
    </location>
    <location path="UserLogin.aspx">
        <system.web>
            <authorization>
                <allow users="?"/>
            </authorization>
        </system.web>
    </location>
    <location path="UniversityLogin.aspx">
        <system.web>
            <authorization>
                <allow users="?"/>
            </authorization>
        </system.web>
    </location>

posted @ 2009-10-14 11:31  Jason.Bird  阅读(206)  评论(0编辑  收藏  举报