The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by isbhatia]

Hi All,
I am converting my existing application in ASP to ASP.NET.But I am
facing problems in maintaining the session state across the pages.Kindly help.

Regards
Inderjeet
import-bot (20211) [Avatar] Offline
#2
Re: Session Transfer bet ween ASP and ASP.NET
[Originally posted by fgrimes]

Hi Inderjeet,

>> I am converting my existing application in ASP to ASP.NET.
>> But I am facing problems in maintaining the session state
>> across the pages.Kindly help.

You don't say what the "problems" are. For an overview of ASP.NET
application/session state, and several examples, see sec 8.8 "Managing
Application and Session State" in the book.

Fergal
import-bot (20211) [Avatar] Offline
#3
Re: Session Transfer bet ween ASP and ASP.NET
[Originally posted by sudhansu]

classic asp session variable can not be access in asp.net.
skeletonkeyz (1) [Avatar] Offline
#4
Re: Session Transfer bet ween ASP and ASP.NET
I recently had the same issue while converting an ecomerce website from Classic Asp top ASP.Net. I chose to encapsulate the required data into two objects which I then create instances of at the time a new session starts. I then insert the objects into the Session cache.

Say for instance you want to trap information about users. I would create a class named "user" or something meaningful, compile it into a libray. In my global.asax make refrence to it like so

<%@ Assembly Name="Class Name"%>

in you session start event handler
public void Session_Start(Object sender, EventArgs e)
{
cMyClass aClass = new cMyclass();
// Insert object into session cache
Session["aClass"] = aClass;
}

To access the object...
cMyClass aClass = (cMyClass ) Session["aClass"];

Regards