[心得] 潮

看板NDHU_CSIE12作者 (DC)時間15年前 (2010/11/03 16:38), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
Session protected void Button1_Click(object sender, EventArgs e) { // 設定Session變數 Session["UserName"] = txtUser.Text; Session["UserPassword"] = txtPass.Text; // 轉址到其他ASP.NET網頁 Response.Redirect("Ch7-5-2.aspx"); } protected void Page_Load(object sender, EventArgs e) { string name, password; lblOutput.Text = "Session ID:" + Session.SessionID + "<br/>"; if (Session["UserName"] != null) { // 取得Session變數值 name = Session["UserName"].ToString(); password = Session["UserPassword"].ToString(); // 顯示取得的Session變數值 lblOutput.Text += "名稱: " + name + "<br/>"; lblOutput.Text += "密碼: " + password + "<br/>"; Session.Abandon(); // 放棄Session } } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 134.208.3.230

11/08 17:14, , 1F
這啥= =
11/08 17:14, 1F
文章代碼(AID): #1CqH-8LV (NDHU_CSIE12)