那你能不能不在web.config里设置呢?

解决方案 »

  1.   

    你的登录结果没有被保存,你还需要在登录页,即本例中的WebForm1.aspx进行处理,代码中必须有如下:
    Web.Security.FormsAuthentication.RedirectFromLoginPage(strname, False)第二个参数为false时,相当于提供了一个session变量,如果为true,则提供了一个cookie有关详情,参见msdn或是quickstart
      

  2.   

    <authentication mode="Forms">
          <forms name="login" loginUrl="Login.aspx" protection="All" />
        </authentication>
        <authorization>
          <deny users="?" />
        </authorization>
    if (password="a")
    {FormsAuthentication.RedirectFromLoginPage(, False)
    }
      

  3.   

    呵呵,没有FormsAuthentication 确认哦