Accessing Session variables defined in ASP page in the ASPX page

Discussion in 'ASP .Net' started by =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=, Aug 17, 2005.

  1. I have a session variable defined in the ASP page. This ASP application then
    also uses ASPX pages. I am unable to read the value of the session variable
    in the ASPX page. The value shown is empty.

    What could be the reason? Please help.

    Thanks
     
    =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=, Aug 17, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=

    Marina Guest

    If you google this question, you will see that it has been asked hundreds of
    times.

    The answer, is that ASP and ASP.NET run as 2 different processes, and thus
    cannot share session.

    "Sachin Vaishnav" <Sachin > wrote in
    message news:...
    >I have a session variable defined in the ASP page. This ASP application
    >then
    > also uses ASPX pages. I am unable to read the value of the session
    > variable
    > in the ASPX page. The value shown is empty.
    >
    > What could be the reason? Please help.
    >
    > Thanks
     
    Marina, Aug 17, 2005
    #2
    1. Advertising

  3. Sachin,

    ASP and ASP.NET run in two completely different processes, so they
    cannot share session values.

    You can work around this by "mapping" values placed in classic ASP
    session into ASP.NET session. This would take some additional code and
    likely a redirect from the ASP that sets the session value to an ASPX
    that will place the same value in ASP.NET session, but it can and has
    been done before.

    If you need more details, let me know and I'll dig up and post some
    source code for you.

    Thanks,
    Denny
     
    Denny Boynton, Aug 17, 2005
    #3
  4. Here's the official Microsoft way to do that :

    http://www.microsoft.com/downloads/...bc-6c0b-4dcf-b7b6-2f57e7c73587&displaylang=en




    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Sachin Vaishnav" <Sachin > wrote in message
    news:...
    >I have a session variable defined in the ASP page. This ASP application then
    > also uses ASPX pages. I am unable to read the value of the session variable
    > in the ASPX page. The value shown is empty.
    >
    > What could be the reason? Please help.
    >
    > Thanks
     
    Juan T. Llibre, Aug 17, 2005
    #4
  5. Re: Accessing Session variables defined in ASP page in the ASPX pa

    Hi Marina,
    thanks for the response.
    Can you guide me about any work around?

    "Marina" wrote:

    > If you google this question, you will see that it has been asked hundreds of
    > times.
    >
    > The answer, is that ASP and ASP.NET run as 2 different processes, and thus
    > cannot share session.
    >
    > "Sachin Vaishnav" <Sachin > wrote in
    > message news:...
    > >I have a session variable defined in the ASP page. This ASP application
    > >then
    > > also uses ASPX pages. I am unable to read the value of the session
    > > variable
    > > in the ASPX page. The value shown is empty.
    > >
    > > What could be the reason? Please help.
    > >
    > > Thanks

    >
    >
    >
     
    =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=, Aug 17, 2005
    #5
  6. Re: Accessing Session variables defined in ASP page in the ASPX pa

    Hi Denny,

    Thanks for the details. I would really appreciate if you can post some code,
    showing what you have explained.

    Thanks,
    Sachin


    "Denny Boynton" wrote:

    > Sachin,
    >
    > ASP and ASP.NET run in two completely different processes, so they
    > cannot share session values.
    >
    > You can work around this by "mapping" values placed in classic ASP
    > session into ASP.NET session. This would take some additional code and
    > likely a redirect from the ASP that sets the session value to an ASPX
    > that will place the same value in ASP.NET session, but it can and has
    > been done before.
    >
    > If you need more details, let me know and I'll dig up and post some
    > source code for you.
    >
    > Thanks,
    > Denny
    >
    >
     
    =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=, Aug 17, 2005
    #6
  7. =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=

    Paul Clement Guest

    Re: Accessing Session variables defined in ASP page in the ASPX pa

    On Wed, 17 Aug 2005 12:07:39 -0700, Sachin Vaishnav <>
    wrote:

    ¤ Hi Denny,
    ¤
    ¤ Thanks for the details. I would really appreciate if you can post some code,
    ¤ showing what you have explained.
    ¤

    Check out Juan's post in the thread.


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
     
    Paul Clement, Aug 17, 2005
    #7
  8. =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=

    Rosanne Guest

    Rosanne, Aug 17, 2005
    #8
    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. =?Utf-8?B?ZG90bmV0dGVzdGVy?=

    accessing variables in Custom Control, defined in page.

    =?Utf-8?B?ZG90bmV0dGVzdGVy?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    376
    =?Utf-8?B?ZG90bmV0dGVzdGVy?=
    Aug 3, 2005
  2. Michael
    Replies:
    3
    Views:
    1,146
    Jim Cheshire
    Dec 30, 2005
  3. Oodini
    Replies:
    1
    Views:
    1,779
    Keith Thompson
    Sep 27, 2005
  4. Dax Westerman
    Replies:
    1
    Views:
    187
    Dax Westerman
    Aug 19, 2003
  5. Thomas Luedeke
    Replies:
    7
    Views:
    114
    Stefano Crocco
    Aug 12, 2008
Loading...

Share This Page