本帖最后由 Sandy945 于 2011-12-13 16:40:24 编辑

解决方案 »

  1.   

    http://topic.csdn.net/u/20090608/16/54579a1f-5932-44c2-886d-0b2c0268237c.html我有这个这种登录窗口的登录……
      

  2.   

    还有比如说我请求 1.index然后发现他没登陆,页面跳转到login.aspx登陆成功再跳转到1.index.aspx怎么实现奥!用户进去的时候 把用户名保存到 session中,,然后在每个页面判定 session 是否为空、为空就强制返回登录页面。
      

  3.   

    我来继续7楼的回答
    index.aspx 页面:
    if(session = 空)
    {
        记录当前页面URL;
         跳转到login.aspx
    }Login.aspx 页面
    if(登录成功)
    {
        //判断存储的当前url 是否为空
         if(是空的)
         { 
               
          } 
          else
              执行页面回跳
    }
      

  4.   

    在web.config文件中配置一下验证方式为forms <authentication mode="Forms">
    <forms defaultUrl="admin/main.aspx" loginUrl="login.aspx" protection="All" timeout="60" path="/">
    <credentials passwordFormat="Clear">
    <user name="xxxx" password="xxxx"/>
    </credentials>

    </forms>

    </authentication>
      

  5.   

    这位兄台, 你这这代码就没写完呀。 既然选择用form验证了。何不把登陆事件写全些。