Global.asa, AcquireRequestState and Session

Discussion in 'ASP .Net' started by Raghu, Feb 17, 2005.

  1. Raghu

    Raghu Guest

    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/..
    Raghu, Feb 17, 2005
    #1
    1. Advertising

  2. Raghu

    Raghu Guest

    Landed on the solution right after sending this this message.

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

    Thanks.
    Raghu/..

    "Raghu" <> wrote in message
    news:...
    > 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/..
    >
    >
    Raghu, Feb 17, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne
    Replies:
    2
    Views:
    467
    Wayne
    Nov 11, 2003
  2. =?Utf-8?B?Sm9lbCBBdWZnYW5n?=

    Slow AcquireRequestState

    =?Utf-8?B?Sm9lbCBBdWZnYW5n?=, May 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    838
    =?Utf-8?B?Sm9lbCBBdWZnYW5n?=
    May 12, 2006
  3. =?Utf-8?B?SGFycnkgS2Vjaw==?=

    Why would AcquireRequestState fire multiple times?

    =?Utf-8?B?SGFycnkgS2Vjaw==?=, Sep 29, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    508
    =?Utf-8?B?SGFycnkgS2Vjaw==?=
    Sep 29, 2006
  4. Phil Johnson
    Replies:
    0
    Views:
    737
    Phil Johnson
    Jul 20, 2009
  5. Vince C.
    Replies:
    1
    Views:
    239
    Vince C.
    Apr 3, 2004
Loading...

Share This Page