Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use \ create application instance level variables

Status
Not open for further replies.

simonfarrell

Programmer
Aug 22, 2003
3
0
0
GB
I am creating an on-line store. It has several pages and I would like to share data for each instance of the application.

I think I need to declare the variables in my Global.asax file but I'm not sure.

How would I do this and how would I reference the variables from within a page.

 
Sharing data in this way is sharing data at the server.

If this is a shopping cart for your users then typically you park this data in client based cookies.

Hope this helps.

Gary
 
Do you have a quick sample you could copy and pate in ?

thanks
 
At the server you use the Response.Cookies.Add("myCookie") to add a HTTPCookie object and Request.Cookies.Get("myCookie").Value to read a cookies value. Look at the help for these objects to understand a bit more. You could either save products as an array of cookies or maybe save a comma delimited list of products in the basket in a single cookie.

Hope this helps...

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top