asp.net – viewstate到期了吗?

假设你有一个不依赖于会话的aspx页面,但是依赖于viewstate在回发之间的持久性。

如果用户正在访问此页面,并且休息一下,午餐时间长,返回时是否仍然有效?

解决方法

没有ViewState作为PostBack流程的一部分。但是,您可以使用 override页面类的SavePageStateToPersistenceMedium()和LoadPageStateFromPersistenceMedium()来实现该行为。有关 Understanding the ASP.NET ViewState的更多信息。

请注意,ViewState存储在Session中,因此如果Session失效,ViewState将会丢失。我不会说这是ViewState到期,但是,会话超时后会被销毁。

相关文章

判断URL文件是不是在于在。private static bool UrlIsExist(...
由于在.net中,Request时出现有HTML或Javascript等字符串时,...
public static bool ProcessIdCard(this string idCard, out...
protected void Page_Load(object sender, EventArgs e){ Sc...