可以给每个用户建立session或cookie,在验证。

解决方案 »

  1.   

    在每一个页面检测用户有没有登录(例如使用Session),如果没有则返回到登录页面。
      

  2.   

    在pageload里面先判断嘛
    if(Session["logon"]==null){
       //重新定位到登陆页面
    }
      

  3.   

    Forms-Based Authentication 
    http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx
      

  4.   

    表单验证,如下
    web.config <authentication mode="Forms">     <forms name=".aspauth" loginUrl="Login.aspx" path="/"></forms>  
        <!--  授权 
              此节设置应用程序的授权策略。可以允许或拒绝用户或角色访问
              应用程序资源。通配符:"*" 表示任何人,"?" 表示匿名 
              (未授权的)用户。
        -->
        </authentication>
         <authorization>
            <allow users="User1,User2" /> <!-- 允许所有用户 -->
    <deny users="?" />
                <!--  <allow     users="[逗号分隔的用户列表]"
                                 roles="[逗号分隔的角色列表]"/>
                      <deny      users="[逗号分隔的用户列表]"
                                 roles="[逗号分隔的角色列表]"/>
                -->
        </authorization>login.aspx的后台代码中if User1通过验证 thenSystem.Web.Security.FormsAuthentication.RedirectFromLoginPage("User1", False)end if
      

  5.   

    up.
    一般还是建一个数据库表user;
    判断密码,然后 FormsAuthentication.SetAuthCookie(txtusername.Value, False)
    以后判断一下
      

  6.   

    将用户信息在登录时写入cookie并设定有效期。在页面中读取该cookie来断定用户是否登录。