Connecting Tech Pros Worldwide Forums | Help | Site Map

How to use session variables?

Me
Guest
 
Posts: n/a
#1: Sep 20 '06
I am unable to pass the values using session variables.
Here is what I tried thus far -

1. In the 1st program I have created a session variable called name
Session.Name= <the value I would like to pass>

2. In the next program how do I use it?

I tried a few things but it doesn't work.

Thanks for your help in advance.

-Me


CJM
Guest
 
Posts: n/a
#2: Sep 20 '06

re: How to use session variables?



"Me" <Me@discussions.microsoft.comwrote in message
news:AE70CB38-63D3-4615-9E70-C8E12EA364F9@microsoft.com...
Quote:
>
1. In the 1st program I have created a session variable called name
Session.Name= <the value I would like to pass>
>
Session("Name") = "My Name"
Quote:
2. In the next program how do I use it?
>
Response.Write "My Name is " & Session("Name")
Quote:
I tried a few things but it doesn't work.
>
You might want to try a few more. Session variables aren't the best way to
pass variables from page to page - they can quickly suck up your servers
resources, even in a very modest application.. You could use querystrings,
forms or storing your session state in a database.
Quote:
Thanks for your help in advance.
>
Not probs.

CJM


Me
Guest
 
Posts: n/a
#3: Sep 20 '06

re: How to use session variables?


CJM,

Thanks for the reply!
Where can I find the doc on creating and using session variables?
In our case resources isn't an issue (at least now).

Thank you,
-Me


"CJM" wrote:
Quote:
>
"Me" <Me@discussions.microsoft.comwrote in message
news:AE70CB38-63D3-4615-9E70-C8E12EA364F9@microsoft.com...
Quote:

1. In the 1st program I have created a session variable called name
Session.Name= <the value I would like to pass>
>
Session("Name") = "My Name"
>
Quote:
2. In the next program how do I use it?
>
Response.Write "My Name is " & Session("Name")
>
Quote:
I tried a few things but it doesn't work.
>
You might want to try a few more. Session variables aren't the best way to
pass variables from page to page - they can quickly suck up your servers
resources, even in a very modest application.. You could use querystrings,
forms or storing your session state in a database.
>
Quote:
Thanks for your help in advance.
>
Not probs.
>
CJM
>
>
>
Bob Barrows [MVP]
Guest
 
Posts: n/a
#4: Sep 20 '06

re: How to use session variables?


The documentation for ASP is here:
http://msdn.microsoft.com/library/en...f33a651779.asp

But there really isn't much to using session variables, as long as you
remember that they are application-specific. Check the documentaion to
clarify application boundaries. At its simplest, all pages in a virtual
directory belong to the same application.

Me wrote:
Quote:
CJM,
>
Thanks for the reply!
Where can I find the doc on creating and using session variables?
In our case resources isn't an issue (at least now).
>
Thank you,
-Me
>
>
"CJM" wrote:
>
Quote:
>>
>"Me" <Me@discussions.microsoft.comwrote in message
>news:AE70CB38-63D3-4615-9E70-C8E12EA364F9@microsoft.com...
Quote:
>>>
>>1. In the 1st program I have created a session variable called name
>>Session.Name= <the value I would like to pass>
>>>
>>
>Session("Name") = "My Name"
>>
Quote:
>>2. In the next program how do I use it?
>>>
>>
>Response.Write "My Name is " & Session("Name")
>>
Quote:
>>I tried a few things but it doesn't work.
>>>
>>
>You might want to try a few more. Session variables aren't the best
>way to pass variables from page to page - they can quickly suck up
>your servers resources, even in a very modest application.. You
>could use querystrings, forms or storing your session state in a
>database.
>>
Quote:
>>Thanks for your help in advance.
>>>
>>
>Not probs.
>>
>CJM
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Closed Thread