Can i maintain ASP and ASP.NET Sessions on a same page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • royson
    New Member
    • Jan 2008
    • 2

    Can i maintain ASP and ASP.NET Sessions on a same page?

    Hi Guys,
    I have a problem, i am migrating from existing asp web application to asp.net web application. The existing asp application holds user session variables. I can share those session variables between asp and asp.net applications by storing it in database, but my actual problem is after i logging in to asp app i redirect the page to asp.net web page. Now asp.net session is creating in application start...after a postback asp.net session expires!! asp session exists.
    Is it possible to maintain asp and asp.net sessions on a same page with or without HTML frames?
  • leoiser
    New Member
    • Jul 2007
    • 41

    #2
    ASP & ASP.NET can not maintain the same sessions.you can not access ASP page sessions in ASP.Net. One option is create a page that will pass all the session from ASP page to requested ASP.Net page & vice versa

    For example you ve a ASP page, let it be page1.asp while clicking the button you need to goto page1.aspx Create a page PassASPSession. asp which will ve the code

    string sSessions = "";
    for(int i=0;i<Session.C ount;i++)
    {
    sSessions = sSessions + "&" Session.Keys[i].ToString() + "=" + Session[i].ToString() );
    }

    redirect to the page you want to...
    page = "GETASPXSession .aspx?" + sSessions.subst ring(1)

    -----------------------------------------------
    GETASPXSession. aspx

    in this page assign all the values in session using querystring values & redirect to the corresponding aspx page


    Hope u got the idea....

    Comment

    • royson
      New Member
      • Jan 2008
      • 2

      #3
      I don't have a problem of transferring the session values between asp and asp.net applications because i am using database to save and access. My problem is i can able to create both asp session and asp.net session on a page with 2 html frames, but only asp session exists after a postback.
      My question is can i maintain asp session and asp.net session on a same page which has asp page in one frame and asp.net page in another frame?

      Comment

      • Guru Prasadh
        New Member
        • Feb 2008
        • 1

        #4
        we are migrating one single asp page of an application to asp.net and have managed to maintain session between the pages by creating the new .net page under a new virtual directory in the existing website.

        sorry - didn't read the last bit properly. virtual directory won't solve the problem in your case.

        Comment

        Working...