protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Sessioninfo(); } Session.Remove("info"); } private void Sessioninfo() { if (Session["info"] != null) tc.Text = Session["info"].ToString(); } private void sessionadd() { Session.Add("info", tc.Text); } //事件中添加 sessionadd();