日期:2014-05-17 浏览次数:20531 次
 #region 写入Session
            if (!string.IsNullOrEmpty(this.TextBox1.Text))
            {
                Session["Save_Value"] = this.TextBox1.Text;
            }
            #endregion
            #region 读取Session
            string temp = Session["Save_Value"] == null ? string.Empty : Session["Save_Value"].ToString();
            #endregion
------解决方案--------------------
 if (!string.IsNullOrEmpty(this.TextBox1.Text))
           {
               Session["Value"] = this.TextBox1.Text;
           }
  
          //获取Session值
private string _Value
{
  { get { return string.IsNullOrEmpty(Session["QuestionID"]) ? string.Empty : Session["QuestionID"].Trim(); } }
}
      
     不用的时候,清空Session
  Session.Clear();