我有一个 C# 手机站点,但是一些移动客户端存在问题。我在下面发布了一个跟踪,但基本上是手机的浏览器或连接到互联网的 WAP 网关会对表单中的 ViewState 隐藏输入进行 URL 编码。
是否有任何方法可以在处理之前覆盖并解码 ViewState 信息?
变成了/wEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA==
因此 ViewState 失败。%2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D
是否有任何方法可以在处理之前覆盖并解码 ViewState 信息?
System.Web.HttpException: 此页的状态信息无效,可能已损坏。 ---> System.Web.UI.ViewStateException: 无效的 ViewState。 客户端 IP:65.91.116.34 端口:37172 User-Agent:SCH-R430 UP.Browser/6.2.3.8 (GUI) MMP/2.0 ViewState:%2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D Referer: 路径:/mobile/Inbox.aspx ---> System.FormatException: Base-64 字符串中有无效字符。 at System.Convert.FromBase64String(String s) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() --- 内部异常堆栈跟踪的结尾 --- --- 内部异常堆栈跟踪的结尾 --- at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.mobile_inbox_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)