Session not available in Application_PreRequestHandlerExecute

  • Thread starter Thread starter Ben Fidge
  • Start date Start date
B

Ben Fidge

After converting my project to ASP.NET 2.0 any reference to the Session[]
object returns a null reference within Application_PreRequestHandlerExecute
events.

This worked fine in APS.NET 1.1, so can anyone please recommend an
alternative method of achieving the following functionality:

Under certain circumstances I want to redirect users away from default.aspx
to another page. The decision on whether to do this is made according to a
value set in Session[].

Many thanks

Ben
 
I must add to my previous post that testing if session does not equal null results in an error too.

Ie

protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e) {
if (Session != null) { // <-- throws error
}
}

Ben
 
Back
Top