拜托,你的值本来就是Name好不好

解决方案 »

  1.   

    //存入Session
    Session["ID"]="ID";
    Session["Name"]="Name";//取出Session中的内容
    if (Session["ID"] != null)//如果Session["ID"]不为空,前面赋值了,肯定不为空啊
    {
    this.Label1.Text = Session["Name"].ToString();//语句执行到此
    }
    else
    {
    Response.Redirect("loginFail.htm");
    }
      

  2.   

    在判断时Session是不为空的!  
    可以通过判断正常进入第2个页面!
    if (Session["ID"] != null)
    {
    Response.Redirect("loginFail.htm");
    }
    else
    {
    this.Label1.Text = Session["Name"].ToString();
    }
      

  3.   

    唉,迟到了,HOHO
    楼主不够细心...
      

  4.   

    Session["Name"]="Name";你自己写入值了,当然显示是Name了,不显示Name那才不正常呢?
      

  5.   

    //存入Session
    Session["ID"]=this.Label1.Text;
    Session["Name"]="Name";//有值//取出Session中的内容
    if (Session["ID"] != null)
    {
    this.Label1.Text = Session["Name"].ToString();}
    else
    {
    Response.Redirect("loginFail.htm");
    }
      

  6.   

    在判断时Session是不为空的!  
    可以通过判断正常进入第2个页面!
    if (Session["ID"] != null)
    {
    Response.Redirect("loginFail.htm");
    }
    else
    {
    this.Label1.Text = Session["Name"].ToString();
    }Session["Name"]="Name";你自己写入值了,当然显示是Name了