By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,247 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,247 IT Pros & Developers. It's quick & easy.

Problems with accessing ASP.NET Session values in ASP

P: n/a
Hi!
I'm porting an ASP application to ASP.NET 1.1 and having problems with
accessing Session values in ASP that were created and initialized in ASP.NET
1.1.

For example, I added a variable in an ASP.NET pages Page_Load routine, C#:

Int32 Member = 12;
Session.Add("Member", U_Member.ToString());

When I try to access it in an ASP page as follows:

<%
Dim Member
U_Member = Session("Member")
%>

U_Member is empty!

Can any one help me on this!

/Thanks
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I think that you've got your variables wrong.
Int32 Member = 12;
Session.Add("Member", U_Member.ToString()); Shouldn't the last statement be:
Session.Add("Member", Member.ToString())?
If so then retreiving the Member parameter from session object will return
"12".
Hope this helps

K#

"Anders Jansson" <An***********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com... Hi!
I'm porting an ASP application to ASP.NET 1.1 and having problems with
accessing Session values in ASP that were created and initialized in
ASP.NET
1.1.

For example, I added a variable in an ASP.NET pages Page_Load routine, C#:

Int32 Member = 12;
Session.Add("Member", U_Member.ToString());

When I try to access it in an ASP page as follows:

<%
Dim Member
U_Member = Session("Member")
%>

U_Member is empty!

Can any one help me on this!

/Thanks

Nov 19 '05 #2

P: n/a
You can't. ASP and ASP.Net share different memory spaces. The best you can do
is to come up with some other scheme to share session values. i.e. as a
common database table, pass in querystrings, etc..

We've done this on a number of apps and it's a pain but it does work.

John Stemper

"Anders Jansson" wrote:
Hi!
I'm porting an ASP application to ASP.NET 1.1 and having problems with
accessing Session values in ASP that were created and initialized in ASP.NET
1.1.

For example, I added a variable in an ASP.NET pages Page_Load routine, C#:

Int32 Member = 12;
Session.Add("Member", U_Member.ToString());

When I try to access it in an ASP page as follows:

<%
Dim Member
U_Member = Session("Member")
%>

U_Member is empty!

Can any one help me on this!

/Thanks

Nov 19 '05 #3

P: n/a
Here's a reference with some decent information.

http://msdn.microsoft.com/library/de...rttoaspnet.asp

John Stemper

"Anders Jansson" wrote:
Hi!
I'm porting an ASP application to ASP.NET 1.1 and having problems with
accessing Session values in ASP that were created and initialized in ASP.NET
1.1.

For example, I added a variable in an ASP.NET pages Page_Load routine, C#:

Int32 Member = 12;
Session.Add("Member", U_Member.ToString());

When I try to access it in an ASP page as follows:

<%
Dim Member
U_Member = Session("Member")
%>

U_Member is empty!

Can any one help me on this!

/Thanks

Nov 19 '05 #4

P: n/a
Hi,

Sharing sessions between ASP.Net and ASP is not possible directly. Microsoft
has given one solution to make it done. But it won't work if both ASP and
ASPX are under different domains.

Link is :
http://msdn.microsoft.com/library/de...asp?frame=true

Regards
Suresh.

"Anders Jansson" <An***********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
Hi!
I'm porting an ASP application to ASP.NET 1.1 and having problems with
accessing Session values in ASP that were created and initialized in ASP.NET 1.1.

For example, I added a variable in an ASP.NET pages Page_Load routine, C#:

Int32 Member = 12;
Session.Add("Member", U_Member.ToString());

When I try to access it in an ASP page as follows:

<%
Dim Member
U_Member = Session("Member")
%>

U_Member is empty!

Can any one help me on this!

/Thanks

Nov 19 '05 #5

P: n/a
Thanks all for your answers. I suspected that it would not work!!
"Suresh" wrote:
Hi,

Sharing sessions between ASP.Net and ASP is not possible directly. Microsoft
has given one solution to make it done. But it won't work if both ASP and
ASPX are under different domains.

Link is :
http://msdn.microsoft.com/library/de...asp?frame=true

Regards
Suresh.

"Anders Jansson" <An***********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
Hi!
I'm porting an ASP application to ASP.NET 1.1 and having problems with
accessing Session values in ASP that were created and initialized in

ASP.NET
1.1.

For example, I added a variable in an ASP.NET pages Page_Load routine, C#:

Int32 Member = 12;
Session.Add("Member", U_Member.ToString());

When I try to access it in an ASP page as follows:

<%
Dim Member
U_Member = Session("Member")
%>

U_Member is empty!

Can any one help me on this!

/Thanks


Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.