Session("counter") vs. ViewState("counter")...a newbie question

T

The Eeediot

Okay, I'm going to take one more kick at this dead horse to see if I understand this stuff.

· Session("counter") store this information on the web server (i.e. server side) and can be accessed by any pages within the web application.

· ViewState("counter") stores this information on the page (i.e. client side) and is only accessible within that individual page.

Am I missing anything?

===========
I have a mind like a steel trap...the trouble is getting it open!
 
M

Marina

Everything you said is true.

Also, there are other considerations. Store too many things in your ViewState, and your pages become bloated and slow. Store too many in session state, and with many users you get low on memory.

Restart your web app or reboot your machine, and you lose your session state info, unless you are using sql server.
Okay, I'm going to take one more kick at this dead horse to see if I understand this stuff.

· Session("counter") store this information on the web server (i.e. server side) and can be accessed by any pages within the web application.

· ViewState("counter") stores this information on the page (i.e. client side) and is only accessible within that individual page.

Am I missing anything?

===========
I have a mind like a steel trap...the trouble is getting it open!
 
P

Peter Rilling

You seem to have the basic idea down.

Okay, I'm going to take one more kick at this dead horse to see if I
understand this stuff.

· Session("counter") store this information on the web server (i.e. server
side) and can be accessed by any pages within the web application.

· ViewState("counter") stores this information on the page (i.e. client
side) and is only accessible within that individual page.

Am I missing anything?

===========
I have a mind like a steel trap...the trouble is getting it open!
 
G

Guest

Add one thing: ViewState is used for postback. So everything is gone if you
refresh page.
 

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,777
Messages
2,569,604
Members
45,222
Latest member
patricajohnson51

Latest Threads

Top