我有一个会话,其中包含我在Main.aspx
上创建的List(of String)
。在我的Global.asax
中,执行以下代码以在Timer
被触发后检索Session
值。尝试获取Global.asax中的会话值,但它是NULL
Private Sub Application_AcquireRequestState(sender As Object, e As EventArgs)
If System.Web.HttpContext.Current.Session IsNot Nothing Then
If Session("Products") IsNot Nothing Then
Response.Write(Session("Products").ToString())
End If
End If
End Sub
然而,Session("Products")
返回null,Sub
退出。我想知道End Sub
Main.aspx
是否会释放Session
,因此每当Timer
启动时,Session
都是空的。有什么想法吗?
您好,也许[这](http://stackoverflow.com/questions/10195791/context-session-object-is-null-in-application-acquirerequeststate)问题可以帮助吗? – nkvu 2013-04-10 16:37:44