Monday, March 26, 2012

Session variable is lost between ASP & ASP.NET pages

Hi folks,

I must be missing something here. I have an ASP page that I create a
Session variable in as follows.

Session ("name")="Joe"

In an ASP.NET page in the same project and the same session, I call the
Session variable as follows:

Dim str As String
str = Session("name")

When I do a Response.Write (str), nothing writes to the screen.

Any thoughts on what is happening here would be appreciatedUhhhh...

Yeah , that is what it will do. It doesn't work like that.

You can check this out
http://www.asp101.com/articles/sidn...ate/default.asp

but ... the thing surprising you, isn't surprising at all. They are
different technologies...
with nothing but the phrase "asp" in common.

"glenn" <glenn@.discussions.microsoft.com> wrote in message
news:16EE097D-5F1E-4742-AB89-E05057E59EA0@.microsoft.com...
> Hi folks,
> I must be missing something here. I have an ASP page that I create a
> Session variable in as follows.
> Session ("name")="Joe"
> In an ASP.NET page in the same project and the same session, I call the
> Session variable as follows:
> Dim str As String
> str = Session("name")
> When I do a Response.Write (str), nothing writes to the screen.
> Any thoughts on what is happening here would be appreciated
re:
>nothing but the phrase "asp" in common

Absolutely...

The seminal work on sharing session state between ASP and ASP.NET is :

"How to Share Session State Between Classic ASP and ASP.NET"
http://msdn.microsoft.com/library/d...erttoaspnet.asp

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"sloan" <sloan@.ipass.net> wrote in message news:%23zLsJArUGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Uhhhh...
> Yeah , that is what it will do. It doesn't work like that.
> You can check this out
> http://www.asp101.com/articles/sidn...ate/default.asp
> but ... the thing surprising you, isn't surprising at all. They are
> different technologies...with nothing but the phrase "asp" in common.
>
>
> "glenn" <glenn@.discussions.microsoft.com> wrote in message
> news:16EE097D-5F1E-4742-AB89-E05057E59EA0@.microsoft.com...
>> Hi folks,
>>
>> I must be missing something here. I have an ASP page that I create a
>> Session variable in as follows.
>>
>> Session ("name")="Joe"
>>
>> In an ASP.NET page in the same project and the same session, I call the
>> Session variable as follows:
>>
>> Dim str As String
>> str = Session("name")
>>
>> When I do a Response.Write (str), nothing writes to the screen.
>>
>> Any thoughts on what is happening here would be appreciated

0 comments:

Post a Comment