A class visible through out the site?

M

Mustafa Rabie

I have a registeration which is divided on 3 pages, i want to have a class
that i can create on the 1st page, collect the data from page 1 and add the
values to vars in the class, then page 2 and add to vars then page 3 and add
vars then i call a web service @ page 3 and send all the data i collected.

i created a static global class, but it doesnt create a new instance every
call for the app, so if i have 2 ppl using the app it wont keep the vars
sperated.

thanks
mustafa
 
J

jongalloway

It sounds like you're talking about Session data, and should look at
using the ASP.NET built in support for Session. I know I had been
taught not to use Session in Classic ASP, but the ASP.NET Session
System is efficient and scalable.

If you're storing per-user information at the application level, you're
not going to expire it when the application times out, you may have to
deal with concurrency issues, etc. Session handles all that for you.

Plus, if you use Session you can switch to a Session Server or use SQL
Server Session State which will allow you to run your application in a
load balanced environment if required later. If you're storing the
information in memory, you can't scale out.
- Jon
http://weblogs.asp.net/jgalloway
 
M

Mustafa Rabie

thanks a lot fo ryour help guys.
but from my understanding, please correct me if i am wrong, but isn't it
suppose that every call to the web app creates a new instance, with it's own
vars, classes etc? or does that has to be delt with via sessions?

Thanks
Mustafa
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top