【发布时间】:2013-04-10 16:27:08
【问题描述】:
我有一个会话,其中包含我在Main.aspx 上创建的List(of String)。在我的Global.asax 中,我执行以下代码以在Timer 被触发后检索Session 值。
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。我想知道Main.aspx 中的End Sub 是否会释放Session,因此每当Timer 触发时,Session 就会为空。有什么想法吗?
【问题讨论】:
-
您好,this 问题可能有帮助吗?
标签: asp.net vb.net session global-asax