Session not available in Application_PreRequestHandlerExecute

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
 
B

Ben Fidge

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top