protected LosFormatter losFormatter = new LosFormatter(); protected override object LoadPageStateFromPersistenceMedium() { string key = Request.RawUrl + "__viewstate"; if (Session[key] != null) { object obj = null; using (System.IO.MemoryStream stream = (System.IO.MemoryStream)Session[key]) { stream.Seek(0, System.IO.SeekOrigin.Begin); obj = losFormatter.Deserialize(stream); } Session[key] = null; return obj; } return null; } protected override void SavePageStateToPersistenceMedium(object viewState) { string key = Request.RawUrl + "__viewstate"; System.IO.MemoryStream stream = new System.IO.MemoryStream(); losFormatter.Serialize(stream, viewState); stream.Flush(); Session[key] = stream; }
asp.net 隐藏页面<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value=''>的值
最新推荐文章于 2013-08-26 12:00:09 发布