470,594 Members | 1,512 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

session sharing from ASP to ASP.NET

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...how 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 !
Nov 19 '05 #1
4 1604
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.com> wrote in message
news:%2***************@TK2MSFTNGP09.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...how 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 !

Nov 19 '05 #2
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.com> wrote in message
news:%2***************@TK2MSFTNGP09.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...how 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 !

Nov 19 '05 #3
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.dll), 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.com> wrote in message
news:OA**************@TK2MSFTNGP09.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.com> wrote in message
news:%2***************@TK2MSFTNGP09.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...how 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 !


Nov 19 '05 #4
Good info there Scott.
Patrick

"Scott M." <s-***@nospam.nospam> wrote in message
news:OB**************@TK2MSFTNGP12.phx.gbl...
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.dll), 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.com> wrote in message
news:OA**************@TK2MSFTNGP09.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.com> wrote in message
news:%2***************@TK2MSFTNGP09.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...how 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 !



Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Keith Patrick | last post: by
4 posts views Thread by Daniel | last post: by
3 posts views Thread by Mark | last post: by
6 posts views Thread by Andrew Robinson | last post: by
3 posts views Thread by CharlieHoo | last post: by
5 posts views Thread by Soren S. Jorgensen | last post: by
8 posts views Thread by antonyliu2002 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.