<authentication   mode="Forms">   
  <forms   loginUrl   =   "http://login.test.com"   timeout="2"   path="/"   name=".test">   
    
  </forms>   
  </authentication><authorization>   
    <deny   users="?"   />   
  </authorization>在web.config里是这样设置的,每次打开页面就自动去http://login.test.com验证,请问有什么办法可以不让它自动登录.

解决方案 »

  1.   

    <authentication mode="Forms">
          <forms name="MyCheck" loginUrl="Main.aspx" protection="All" path="/" />
     </authentication><location path="Login.aspx">
        <system.web>
          <authorization>
            <deny users="?"/>
          </authorization>
        </system.web>
      </location>
    哪些页面要验证就加上就可以了
      

  2.   

    创建身份验证票之后,在需要做验证的页里的代码里加上
    if(User.Identity.IsAuthenticated)
    {
       .....
    }
    else
    {
      Response.Write("<script language='javascript'>alert('请登录!');window.location.href='登录地址url';</script>");
    }
      

  3.   

    还有,如果你用我说的方法的话
    你需要把
    <authorization>   
        <deny   users="?"   />   
      </authorization>改回
    <authorization>   
        <deny   users="*"   />   
      </authorization>
      

  4.   

    额,是
    <authorization>   
        <allow   users="*"   />   
      </authorization>