DAL  if (sder.Read())
                   {
                       member = new UserTable();
                       member.LoginName = (string)sder["LoginName"];
                       member.UserName = (string)sder["UserName"];
                       member.UserPass = (string)sder["UserPass"];
                       member.Permission = (int)sder["Permission"];
                       return member;
                   }BLL   public static bool LoginMamagerBy(string username, string password)
        {            UserTable table = DAL.UserTableServer.LoginServer(username, password);
                
            if(table==null)
            {
                return false;
            }else
            {
                return true;
            }
         }
     
    }界面  string name = this.TextUserName.Text.Trim();
        string pass = this.TextPassword.Text.Trim();
        
        if (LoginManager.LoginMamagerBy(name, pass))
        {
            UserTable me = new UserTable();
            me.UserName = name;
            me.UserPass = pass;
            Session["me"] = me;
            Response.Redirect("Default4.aspx");
            
        } 请问这样保存到SESSION 除了用户名和密码其它值可以保存吗
 
读取 SESSION 没有登录昵称 
 if (Session["me"] != null)
            {
                UserTable us = new UserTable();
                us = (UserTable)Session["me"];
                this.Label3.Text = us.LoginName;            }

解决方案 »

  1.   

    UserTable 你这个实体类不是还有几个属性吗
    另外的属性也一样的啊
      

  2.   

           if (LoginManager.LoginMamagerBy(name, pass, loginnmae)) 
            { 
                UserTable me = new UserTable();
                me.LoginName = loginname; 
                me.UserName = name; 
                me.UserPass = pass; 
                Session["me"] = me; 
                Response.Redirect("Default4.aspx"); 
                
            }
      

  3.   

    DAL  if (sder.Read()) 
                      { 
                          member = new UserTable(); 
                          member.LoginName = (string)sder["LoginName"]; 
                          member.UserName = (string)sder["UserName"]; 
                          member.UserPass = (string)sder["UserPass"]; 
                          member.Permission = (int)sder["Permission"]; 
                          return member; 
                      } BLL  public static UserTable LoginMamagerBy(string username, string password) 
            {             UserTable table = DAL.UserTableServer.LoginServer(username, password); 
                    
                return table;
            } 
        
        } 界面  string name = this.TextUserName.Text.Trim(); 
            string pass = this.TextPassword.Text.Trim(); 
            UserTable me = new UserTable(); 
    me=LoginManager.LoginMamagerBy(name, pass)
            if (me) 
            { 
                Session["me"] = me; 
                Response.Redirect("Default4.aspx"); 
                
            } 请问这样保存到SESSION 除了用户名和密码其它值可以保存吗 读取 SESSION 没有登录昵称 
    if (Session["me"] != null) 
                { 
                    UserTable us = new UserTable(); 
                    us = (UserTable)Session["me"]; 
                    this.Label3.Text = us.LoginName; 
                    this.Label4.Text = us.UserName; 
                    this.Label5.Text = us.UserPass; 
                    this.Label6.Text = us.Permission;             }
      

  4.   

          if (me) 
            { 
    } ME 不是BOOL行的 转变不了啊
      

  5.   

    好像可以的吧。
    那这样:
    if (me!=NULL) 
            {