我有一个问题:在我的项目我有一个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
因为我有。 –