S
Stu
Hi,
I am trying to access session variable value from the
'Application_BeginRequest' handler in the global asax file but get the
message - 'Session state not available in this context'. I have tried
loading the current context using 'Dim context As HttpContext =
HttpContext.Current' but get the error 'Object reference not set to an
instance of an object'
Anyone know how you get at this?
Thanks in advance,
Stu
Code:
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim context As HttpContext = HttpContext.Current
If Not IsNothing(context.Session("Test")) Then
context.Session("Test") = "Hello world!"
End If
End Sub
I am trying to access session variable value from the
'Application_BeginRequest' handler in the global asax file but get the
message - 'Session state not available in this context'. I have tried
loading the current context using 'Dim context As HttpContext =
HttpContext.Current' but get the error 'Object reference not set to an
instance of an object'
Anyone know how you get at this?
Thanks in advance,
Stu
Code:
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim context As HttpContext = HttpContext.Current
If Not IsNothing(context.Session("Test")) Then
context.Session("Test") = "Hello world!"
End If
End Sub