I'm sorry, but I'm not stating my opinion on this, it is a fact: Classic
ASP and ASP.NET do not share session data.
The reason is actually quite easy to understand. Classic ASP pages process
their code within the context of the Classic ASP "Engine" (ASP.dll). This
component is what exposes the familiar Classic ASP intrinsic objects
(Request, Response, Server, Application, Session & ASPError). ASP.NET
pages do not process using this engine. Instead they process via the
ASP.NET "Engine" (ASPNET_ISAPI.d ll), which also exposes intrinsic objects
(like Application & Session) BUT they are NOT the SAME objects (not the same
instances and not the same memory addresses), so you may have 1 application
that has both .asp and .aspx pages in it and the .asp pages my be using
Session and the .aspx pages may also be using Session, but these are 2
different Session objects and there is no built in way to port data from one
to the other.
For most people who need to share session data, they will simply persist the
data to some common repository that both architectures can get at (such as a
database). But, since you are needing to persist not just name/value pairs
of data, but instead need to persist COM objects, this becomes more
difficult.
The only way you can use a COM object in ASP.NET is if you have a COM
reference to the COM object (thus creating a Runtime Callable Wrapper or
RCW) in the ASP.NET project. When this is done, you can instantiate the COM
object from within ASP.NET and use it (remembering to use the Marshall class
to release the COM object when you are done with it). But, to *pass* the
COM object to ASP.NET from Classic ASP, you'll need to find a place to store
the COM object that ASP.NET can get to and the Classic ASP Session object is
not it.
"abcd" <ab**@abcd.co m> wrote in message
news:OA******** ******@TK2MSFTN GP09.phx.gbl...
I can not change to ASP.NET pages to hold the COM instances. Its a huge
application and we dont want to spend more time on re-engineering. I have
added new functionaly in ASP.NET page and that requires the ASP session
variables...
any sanples !
Microsoft must have considered such design consideration when they
developed ASP.NET. as there are millions of asp based applications.
thanks
Scott M. wrote: Classic ASP pages and ASP.NET pages do not share session data. You
must create your own "bridge" between the two architectures.
One thought would be to use ASP.NET pages in place of the Classic ASP
pages that make the instances of the COM objects and use .NET COM
InterOp to instantiate the COM objects within the ASP.NET pages.
"abcd" <ab**@abcd.co m> wrote in message
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. . I have an ASP application. It instantiaties some COM components and
we put those COM components in Session variables...COM components
have license restrictions... We have written new ASPX page ( for
better GUI and faster development) and we will be using that ASPX
page along with our ASP application...h ow can I pass that Session
variable (which holds COM instance) to ASPX page so that I will be
working on same instance and will not consume licenses....
thanks in advance
cheers !