472,364 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

How to use session variables?

Me
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

Sep 20 '06 #1
3 1283
CJM

"Me" <Me@discussions.microsoft.comwrote in message
news:AE**********************************@microsof t.com...
>
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"
2. In the next program how do I use it?
Response.Write "My Name is " & Session("Name")
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.
Thanks for your help in advance.
Not probs.

CJM
Sep 20 '06 #2
Me
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:
>
"Me" <Me@discussions.microsoft.comwrote in message
news:AE**********************************@microsof t.com...

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"
2. In the next program how do I use it?

Response.Write "My Name is " & Session("Name")
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.
Thanks for your help in advance.

Not probs.

CJM
Sep 20 '06 #3
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:
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:
>>
"Me" <Me@discussions.microsoft.comwrote in message
news:AE**********************************@microso ft.com...
>>>
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"
>>2. In the next program how do I use it?

Response.Write "My Name is " & Session("Name")
>>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.
>>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.
Sep 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
6
by: Lina Manjarres | last post by:
Hello, I have a session variable in a login page. Then I go to a form page where I uses the ProfileID and the UserID. Then I go to a result page where I would like to use the UserID as a filter,...
4
by: PJ | last post by:
A particular page seems to be having issues with correctly setting Session variables. I am setting a couple of session variables on the Page_Unload event. While stepping through code, the...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
3
by: Alan Wang | last post by:
Hi there, Once my application gets complicated and complicated. I found it's really hard to keep track of Session value I am using in my asp.net application. I am just wondering if anyone have...
3
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.