473,378 Members | 1,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Application_OnPreRequestHandlerExecute

My client used the code listed below in Global.asax to trap for Session
timeouts in .Net 1.x, but in 2.0 it causes this error:

Session state is not available in this context.

Is there a configuration change that needs to be made?

--
Sub Application_OnPreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
Dim objHttpApplication As System.Web.HttpApplication
objHttpApplication = sender

If IsNothing(Session("UserID")) Then
Server.Execute("/AppName/Shared/LogOut/LogOut.aspx?LoggedOut=true")
End If

End Sub
Oct 12 '06 #1
0 937

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.