Tôi đang làm việc trên dự án Asp.net, nơi tôi đã tạo một số điều khiển người dùng trên trang động thông qua LoadControl() trên Page Object nhưng khi tôi cố gắng thực hiện bất kỳ postback nào thông qua bất kỳ trang nào tôi nhận được "The state information is invalid for this page and might be corrupted."
ngay cả khi tôi đã đặt Viewstate của điều khiển được tạo động thành false.Cách sửa lỗi Thông tin trạng thái không hợp lệ cho trang này và có thể bị hỏng
Nếu bạn gặp sự cố này, vui lòng cho tôi biết cách bạn khắc phục sự cố.
Các vết đống là: -
[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. ]
System.Convert.FromBase64String(String s) +0
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +77
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
System.Web.UI.HiddenFieldPageStatePersister.Load() +147
[ViewStateException: Invalid viewstate.
[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +198
System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14
System.Web.UI.HiddenFieldPageStatePersister.Load() +251
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +106
System.Web.UI.Page.LoadAllState() +43
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.contact_us_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\otherland_ecom\33f31476\6c5f9007\App_Web_zgmfrrfa.14.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Âm thanh như một vấn đề serialization - vui lòng cung cấp thêm thông tin về cách bạn đã đăng kiểm soát của bạn xem tiểu bang. –
tại thời điểm nào trong vòng đời bạn có tải điều khiển không và bạn có đang tải nó trên tất cả các yêu cầu (không chỉ! Ispostback) không? – Steven
Nơi đầu tiên để kiểm tra, với ngoại lệ, là loại bạn sắp xếp theo thứ tự vào ViewState theo yêu cầu trước (không phải là postback ném ngoại lệ). Một cái gì đó bạn đặt trong lĩnh vực ẩn? –