Surya sasidhar
Surya sasidhar

Reputation: 30333

different between viewstate and sessions?

i want to know what is the difference between viewstate and sessions. thank you

Upvotes: 2

Views: 423

Answers (2)

Fyodor Soikin
Fyodor Soikin

Reputation: 80915

ViewState gets embedded in the form and sent to the browser, then gets submitted as part of form back to the server. Session resides on the server the whole time.

Upvotes: 0

kimtiede
kimtiede

Reputation: 202

Viewstate persists state across postbacks and can therefore hold the state of controls on the page etc.

Session persists data across the whole session of the user and can therefore hold data that needs to be stored for longer time (such as a shopping basket)

Upvotes: 4

Related Questions