简体   繁体   中英

When is ViewState session cleared ?

I know SessionState is Cleared when the session dies - usually after 20min of inactivity. My question is when does ViewState session dies ? Or does it never dies ? Is there any way to clear it ?

Viewstate lasts for as long as it's on the page - it's outputted with the HTML; check the source to your rendered page and you will see a load of text in a hidden field.

Something like:

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTIyODQ4NzI.....

Once the page is gone, it's gone.

You can clear it by calling

ViewState.Clear()

Old ViewState, like old soldiers , never dies, it just fades away...

It's stored in hidden fields in the HTML page, and stays alive in the browser's cache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM