Saving a variable

  • Thread starter Thread starter Andrew Chalk
  • Start date Start date
A

Andrew Chalk

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.
 
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
 
Thanks to all who replied. Your responses were very helpful. I am now using
the Session object.

Regards,

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top