Global.asa, AcquireRequestState and Session

R

Raghu

The global.asax page can have an event handler for AcquireRequestState. This
is where a session can be accessed for the first time before the control
ends up in the target page itself.

However if the target page has its EnableSession property set to false, then
the Session property can not be accessed (either in the page or in
Global.asax) as there will be no session. In such case, if Session property
is accessed, the HttpException (with message: Session is not valid in this
context) is thrown.

Is there a programmatic way (that does not include catching exception) of
detecting if currently executing page has the session disabled in the
global.asax?

Thanks.
Raghu/..
 
R

Raghu

Landed on the solution right after sending this this message.

Context.Session will be null for the pages that disabled session state.

Thanks.
Raghu/..
 

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,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top