Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Session Question...


Message #1 by "LeMay, Al" <All@n...> on Fri, 6 Apr 2001 16:01:35 -0700
All



I have a session variable that I am able to write to, but cannot seem to get

the value out (I set the value on say page1.aspx and then move to page2.aspx

and try to retrieve it).



I have tried the old ASP lingo, but got weird errors, and the MS reference

has nothing on the Systwm.Web.Session namespace.



Any help is appreciated.



Thanks.



Al LeMay

Internet Commerce & Communications

Quality Assurance

al.lemay@n...

xxx.xxx.xxxx





Message #2 by "dave 123aspx.com" <support@1...> on Sat, 7 Apr 2001 08:56:41 -0700
Hi,

Can you post your code?



Cheers!

dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://www.123aspx.com

The Largest ASP.NET Directory

~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------- Original Message ----------------------------------

From: "LeMay, Al" <All@n...>

Reply-To: "ASP+" <aspx@p...>

Date: Fri, 6 Apr 2001 16:01:35 -0700 



>All

>

>I have a session variable that I am able to write to, but cannot seem to get

>the value out (I set the value on say page1.aspx and then move to page2.aspx

>and try to retrieve it).

>

>I have tried the old ASP lingo, but got weird errors, and the MS reference

>has nothing on the Systwm.Web.Session namespace.

>

>Any help is appreciated.

>

>Thanks.

>

>Al LeMay

>Internet Commerce & Communications

>Quality Assurance

>al.lemay@n...

>xxx.xxx.xxxx

>

>

>

Message #3 by "Juan T. Llibre" <j.llibre@c...> on Sat, 7 Apr 2001 12:48:04 -0500

Basically, you just write .ToString the variable's value.

Here's 2 ways to return a session variable's value :



1. Use a function :



<script language="VB" runat=server>

Function GetSessionValue(Key As String) As String

  Return Session(Key).ToString()

End Function

</script>



<body>



<%

Session("Test") = "MyValue"

%>

<%=GetSessionValue("Test")%>



2. Retrieve the value directly to a string :

<%

Response.Write(Session("Test").ToString)

%>



Of course, you don't have to, specifically, write the string.

You could also compare the value; insert the data in a DB; etc.



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=aspx_espanol

http://www.asplists.com/asplists/aspnges.asp

ASP en Espaņol : http://aspespanol.com/

http://www.asplists.com/asplists/aspspanish.asp

ASPTracker's DNS will return in a few days

In the meantime, please use http://207.176.17.138/

==================================



----- Original Message -----

From: "LeMay, Al" <All@n...>

To: "ASP+" <aspx@p...>

Sent: Friday, April 06, 2001 6:01 PM

Subject: [aspx] Session Question...





> All

>

> I have a session variable that I am able to write to, but cannot seem to get

> the value out (I set the value on say page1.aspx and then move to page2.aspx

> and try to retrieve it).

>

> I have tried the old ASP lingo, but got weird errors, and the MS reference

> has nothing on the Systwm.Web.Session namespace.

>

> Any help is appreciated.

>

> Thanks.

>

> Al LeMay






  Return to Index