我有一個問題:在我的項目我有一個LinkButton其執行以下操作:會話變量,餅乾和UpdatePanel的Load事件
Response.Cookies("synthetic_fm_user_session")("session_id") = String_Session_Id
Response.Cookies("synthetic_fm_user_session").Expires = DateTime_Session_Stop
Session("Integer_User_Id") = Integer_User_Id
UpdatePanel.Update()
我的UpdatePanel Load事件看起來像這樣:
If Not Request.Cookies("synthetic_fm_user_session") Is Nothing Then
Panel1.Visible = True
End If
If Not Session("Integer_User_Id") Is Nothing Then
Panel2.Visible = True
End If
然後,當我點擊這個LinkButton,它將會話變量和Cookies設置爲某個值(Not Nothing)並更新UpdatePanel Load事件中的UpdatePanel時,會話變量和Cookie仍然沒有!並在第二個UpdatePanel.Update()會話變量和餅乾變得不是什麼!
爲什麼會發生,以及如何解決它?
是否已進行了肯定被寫入的值不是什麼都沒有? – StefanE
因爲我有。 –