473,503 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving a variable

One page of my ASP.NET application constructs a string variable that is used
in other pages. How should I store the string across pages? I am using the
Session object. Is this the right use for it?

Many thanks.
Nov 19 '05 #1
4 936
I use session. There are some good video tutes over here
(http://msdn.microsoft.com/vstudio/ex...g/default.aspx)
about session state etc. Definately watch those vids though, they talk
about all sorts of variable states and uses.

Oh its lesson 4 btw.

Nov 19 '05 #2
Andrew,

The correct answer depends on the context in which you plan to use that
variable. If it's something specific to the user then you can use the
Session object or even pass it around in a query string. If it's
something that you would like to share across all users then you can
use the Cache or maybe the Application object. Here is a good article
to read: http://aspnet.4guysfromrolla.com/articles/020205-1.aspx

David Barkol
www.neudesic.com

Nov 19 '05 #3
Andrew,

I agree with David. Have a look at
http://www.msdn.microsoft.com/asp.ne...netchapt06.asp

This article should provide you with all you need to know to answer your
question!

Regards

Daniel

"Andrew Chalk" <ac****@magnacartasoftware.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP11.phx.gbl...
One page of my ASP.NET application constructs a string variable that is
used in other pages. How should I store the string across pages? I am
using the Session object. Is this the right use for it?

Many thanks.

Dec 1 '05 #4
Thanks to all who replied. Your responses were very helpful. I am now using
the Session object.

Regards,

Andrew
"Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
One page of my ASP.NET application constructs a string variable that is
used in other pages. How should I store the string across pages? I am
using the Session object. Is this the right use for it?

Many thanks.

Dec 4 '05 #5

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

Similar topics

4
2552
by: john bailo | last post by:
For a c# program to automatically extract information from email attachments using the Outlook 9 OM, rather than saving to a file, then reading the file, I would prefer to 'Save' the attachment to...
3
6497
by: Brenny | last post by:
Hello I'm developing a project by using access database and there is a table(Table1) and it has a field(ml_mik) this is the decimal field. I'm taking a value from windows form as a decimal...
3
1410
by: jad101 | last post by:
I have an asp.net web page that: 1. Shows a message 2. Posts back (using javascript) 3. Reads contents of a file 4. response.write the contents of the file to the browser My issue is this: ...
3
4547
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and...
1
1979
by: M Keeton | last post by:
I currently have a picture which is stored in a "System.Drawing.Image" variable and I want to save it as a bitmap file. I have tried 2 different approaches and both give me the following error: ...
0
1494
by: Chirag Shukla | last post by:
Colleagues, I wanted to share a function to find if a date is in Daylight Saving Time or not. I was able to make this function faster than reading MSDN to find functions that .NET provides. I...
1
2588
by: Magnus | last post by:
I'm testing walkthrough saving data to a Database (Multiple Tables). http://msdn2.microsoft.com/en-us/library/4esb49b4(VS.80).aspx In the famous Customer/Order example, I'm getting referential...
10
2069
by: JoeC | last post by:
I am writing a game and all my game pieces are stored in a single vector of piece handles. I have the basics I can read and write char and number files but I am trying to do comthing more...
0
1375
Ajm113
by: Ajm113 | last post by:
Contributing To: Saving RichTextBox from Tab Control Ok, I have a question what would I use if I wanted to do something like a paste function in a Rich Text Box using the code on that thread?...
1
5750
by: MSwanston | last post by:
Hi I need some help with saving retreiving data from the cache, and how best to structure my code. FYI am working in VS2005/under .NET2 Framework. Ok, we have a series of reports that get run via...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.