Does viewstate expire?

前端 未结 12 1519
-上瘾入骨i
-上瘾入骨i 2020-12-06 04:40

Let\'s say you have a aspx page that does not rely on session, but does rely on viewstate for persistance between postbacks.

If a user is accessing this page, and l

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 05:06

    No ViewState is kept as part of the PostBack process. You can, however, override the Page class's SavePageStateToPersistenceMedium() and LoadPageStateFromPersistenceMedium(), to implement that behavior if desired. For more information read Understanding the ASP.NET ViewState.

    Note that Page ViewState is stored in the Session so if your Session expires, the ViewState will be lost. I wouldn't say this is ViewState expiring, but yes, it will be destroyed after Session timeout.

提交回复
热议问题