代码之家  ›  专栏  ›  技术社区  ›  Blerta

状态信息对此页无效,可能已损坏

  •  3
  • Blerta  · 技术社区  · 14 年前

    在internet explorer中浏览asp.net页时,我收到以下错误。在firefox或mozilla中,一切正常。

     - <pages  enableViewStateMac="false" >
     - <pages enableViewState="false">
     - <pages viewStateEncryptionMode="Never">
     - <pages maxPageStateFieldLength="40">
    

    但似乎什么都不管用。错误如下所示:

    Source Error: 
        [No relevant source lines]
         
        Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\emportalermal\7c94fef4\cccf3353\App_Web_mtkk1qfn.6.cs    Line: 0 
        
        Stack Trace: 
        
        [FormatException: Invalid character in a Base-64 string.]
           System.Convert.FromBase64String(String s) +0
           System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72
           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() +113
        
        [ViewStateException: Invalid viewstate. 
            Client IP: 127.0.0.1
            Port: 
            User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
            ViewState: /wEPDwUKLTk3MzIyNTg5OA9kFgJmD2QWBAIBD2QWAgIJDxYCHgRocmVmBSV+L3Byb19kcm9wbGluZV8xL3Byb19kcm9wbGluZV9pbmQuY3NzZAIDD2QWBgIDD2QWAmYPZBYGAgkPFgIeBWNsYXNzBQZhY3RpdmVkAgsPFgIfAQUGYWN0aXZlZAJBDxYCHwAFFi4uL2FsL2NvbnRhY3RQYWdlLmFzcHhkAgUPZBYKAgEPZBYYAgEPDxYCHghJbWFnZVVybAUnLi4vaW1hZ2VzL0NhdGVnb3J5SW1hZ2VzL3BhcmFwYWd1YXIuZ2lmZGQCAw8PFgQeBFRleHQFCFN0YW5kYXJkHgtOYXZpZ2F0ZVVybAUULi4vYWwvcGFnZS5hc3B4P2lkPTRkZAIFDw8WAh4HVmlzaWJsZWhkZAIHDw8WCB4IQ3NzQ2xhc3MFDmNsaWNrZWRTdWJNZW51HwMFDlN1cGVyIFJpbmlyaW5nHwQFFi4uL2FsL3BhZ2UuYXNweD9pZD05MDgeBF8hU0ICAmRkAgkPDxYCHwVoZGQCCw8PFgIfBWhkZAINDw8WAh8CBSguLi9pbWFnZXMvQ2F0ZWdvcnlJbWFnZXMvbWUga29udHJhdGUuZ2lmZGQCDw8PFgQfAwUETGlmZR8EBRUuLi9hbC9wYWdlLmFzcHg/aWQ9NTBkZAIRDw8WBB8DBQZMaWZlICsfBAUVLi4vYWwvcGFnZS5hc3B4P2lkPTk2ZGQCEw8PFgQfAwUHTGlmZSA2MB...]
        
        [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) +106
           System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14
           System.Web.UI.HiddenFieldPageStatePersister.Load() +217
           System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
           System.Web.UI.Page.LoadAllState() +43
           System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
           System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
           System.Web.UI.Page.ProcessRequest() +80
           System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
           System.Web.UI.Page.ProcessRequest(HttpContext context) +49
           ASP.al_page_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\emportalermal\7c94fef4\cccf3353\App_Web_mtkk1qfn.6.cs:0
           System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
           System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    

    1 回复  |  直到 3 年前
        1
  •  0
  •   Blerta    14 年前

    当然不是最好的解决方案,但很有效:)