Hi guys,
What is the lifespan for items stored in ViewState?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Apr 9, 2012, 7:51 AM
The viewstate is designed to store the value in the viewstate only for the life of the current page. It serialize and deserialize the data whenever store and retrieve. It will be stored on the hidden control in client side and value persisted across the postback.
It will maintain the view state only for the life time of the current page.
If you want to maintain data persist across the pages then you need to use the SessionState, ApplicationState or database.
MuthuMari MPosted Apr 9, 2012, 12:37 AM
Items stored in the ViewState exist for the life of the current page.
This includes postbacks (to the same page).
For more info :
http://stackoverflow.com/questions/3832657/what-is-life-span-for-items-stored-in-view-state
thanks
If this post is useful then mark it as "Accepted Answer"
Keyur NarkhiPosted Apr 9, 2012, 12:33 AM
In asp.net when a form is submitted,form is loaded back with the all the values because of viewstate.
The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a
So the viewstate's life is upto page level.
Thanks