我有一個c#移動網站,並且與一些移動客戶端有問題。我在下面發佈了一個跟蹤,但基本上電話的瀏覽器或手機連接到internet url的wap網關編碼視圖狀態隱藏輸入的形式。asp.net Base-64字符串中的字符無效
/wEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA ==
變得
%2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D
所以視圖狀態失敗。
有沒有辦法重寫和urldecode視圖狀態信息之前進行?
System.Web.HttpException: The state information is invalid for this page and might be corrupted. ---> System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 65.91.116.34 Port: 37172 User-Agent: SCH-R430 UP.Browser/6.2.3.8 (GUI) MMP/2.0 ViewState: %2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D Referer: Path: /mobile/Inbox.aspx ---> System.FormatException: Invalid character in a Base-64 string. 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() --- End of inner exception stack trace --- --- End of inner exception stack trace --- 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)
(刪除我的答案,因爲我沒有發現的「視圖狀態」位) – 2009-10-16 21:14:31