ViewState Question

R

Ralph Krausse

If I created a array of objects in my Page_Load and assigned it to
Application["FOOBAR"], once the web page returns the client, where is
this information held? In the browsers viewstate or somewhere in IIS?
My questions is that I will be querying a database for information. Is
is better to requery or create some object that hold that information
and keep it in memory.

Thanks
Ralph Krausse

www.consiliumsoft.com
Use the START button? Then you need CSFastRunII...
A new kind of application launcher integrated in the taskbar!
ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
 
K

Karl

The Application is stored on the server (specifically in the worker process'
memory space). It has nothing to do with the ViewState, those are two
separate mechanisms.

You need to ask yourself, what's the scope of the data I'm trying to
preserve? Is it global to the application (all users), if so, perhaps you
want the application. Is it specific to a user? then you want the
viewstate.

It's generally wise to try and store the data somewhere so that it doesn't
have to be retrieved again. Where to store it depends on the scope.
You can check out: http://openmymind.net/DataStorage/index.html for more
information on the major players when it comes to this.

Karl
 
H

Hermit Dave

Karl is right... though ask yourself if its user data... how big is it...
its it really worth saving it on client side ? you dont want datasets saved
on viewstate... plus viewstate is available only for the current aspx
page... which means if you want to have the same data in other page... you
will have to keep loading it about..

if you have user specific data and need access across pages then use Session
Object (HttpSession)

if you have massive loads of data to share between users then do not use
Application object... if you hit the application's allocated memory it will
cause the worker process to bounce... meaning you will loose all the data...
in that scenario.. using Cache is better... instead of boucing the app... it
just releases the items... based on priority plus you can stuff like keep it
in cache for 20 mins and if not used remove it... or keep it for a day... or
if used within 20 mins keep it for another 20 mins...

hope this helps

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
Karl said:
The Application is stored on the server (specifically in the worker process'
memory space). It has nothing to do with the ViewState, those are two
separate mechanisms.

You need to ask yourself, what's the scope of the data I'm trying to
preserve? Is it global to the application (all users), if so, perhaps you
want the application. Is it specific to a user? then you want the
viewstate.

It's generally wise to try and store the data somewhere so that it doesn't
have to be retrieved again. Where to store it depends on the scope.
You can check out: http://openmymind.net/DataStorage/index.html for more
information on the major players when it comes to this.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


Ralph Krausse said:
If I created a array of objects in my Page_Load and assigned it to
Application["FOOBAR"], once the web page returns the client, where is
this information held? In the browsers viewstate or somewhere in IIS?
My questions is that I will be querying a database for information. Is
is better to requery or create some object that hold that information
and keep it in memory.

Thanks
Ralph Krausse

www.consiliumsoft.com
Use the START button? Then you need CSFastRunII...
A new kind of application launcher integrated in the taskbar!
ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
 
C

Cor Ligthert

Ralph,

You can store information in

viewstates (information that is saved in the page)
sessions (information that is saved on the server per client)
cache/application (information that is saved for all users togheter as long
as the applicication lives)
shared classes (which is almost the same as direct above however can hold as
well procedures which are as well for all clients)

(Be very careful when you save information in cache/application/shared
classes)

I hope this helps?

Cor
 

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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top