[CLOSED] 'Validation of viewstate MAC failed' message when button clicked

  1. #1

    [CLOSED] 'Validation of viewstate MAC failed' message when button clicked

    I has a button called btnFilter in my aspx Page... this button call de protect sub Filtrar(), what follows

    <script runat="server">
        
        Protected Sub Filtrar(sender As Object, e As System.EventArgs)
            'Segundo o Daniil, na thread gridPanel.Reload error - in the 2.x Premium Help forum of Ext.NET Forums,
            'este Reload ainda não está funcionando, e ele sugeriu usar o seguinte comando. GridPanel1.Call("store.reload");
            'grdSugestoes.Reload()
            grdSugestoes.Call("store.reload")
        End Sub
    
    </script>
    In browsers Google Chrome 16.0.912.75 m, Opera 11.60 Built 1185 and IE 9.0.8112.16421, occurs the error below...
    In browser FireFox 9.0.1, the error don´t occurs, but the button is not fired...
    In IE 9.0.8112.16421 with 'compatibility view mode' checked (menu tools\compatibility view mode), work´s fine, without errors...

    
    Server Error in '/' Application.
    --------------------------------------------------------------------------------
    
    
     Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
    
    Source Error: 
    
    
    
    
    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
    
    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
    
       <%@ Page Language="C#" Debug="true" %>
    
    or:
    
    2) Add the following section to the configuration file of your application:
    
    <configuration>
        <system.web>
            <compilation debug="true"/>
        </system.web>
    </configuration>
    
     Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
    
    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
    
    
    Stack Trace: 
    
    
    
    
    
    [ViewStateException: Invalid viewstate. 
        Client IP: ::1
        Port: 
        Referer: http://localhost:49646/sugestoes/176184179176182
        Path: /sugestoes/176184179176182
        User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
        ViewState: /wEPDwUKLTMzMzgzMjEwMw9kFgICAw9kFgICAQ8PFgIeBFRleHQFBUFDSUpTZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgIFEkxvZ2luU3RhdHVzMSRjdGwwMQUSTG9naW5TdGF0dXMxJGN0bDAzIK899vSeJkU7PiS4VgtWA8MWqzveTKqlTWaLPD6pWD4=]
    
    [HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
       System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +235
       System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
       System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +274
       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() +241
       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.app_sghd_sugestoes_aspx.ProcessRequest(HttpContext context) +37
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
     
    
    
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 
    Last edited by Daniil; Jan 23, 2012 at 7:04 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Is there ASP form on a page?
    <form runat="server">
  3. #3
    Hi Daniil...

    This problem don´t occurs anymore...

    One of the many suggestions of you gave me solved this, probably...

    If I got this problem again, create a new thread...

    Thanks a lot

Similar Threads

  1. [CLOSED] Validation of viewstate MAC failed
    By gidi in forum 1.x Premium Help
    Replies: 5
    Last Post: Mar 01, 2012, 10:15 PM
  2. Validation of viewstate MAC failed... Help!
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Nov 04, 2010, 1:20 PM
  3. Replies: 5
    Last Post: Aug 06, 2010, 2:24 PM
  4. [CLOSED] Failed to load viewstate
    By sharif in forum 1.x Premium Help
    Replies: 6
    Last Post: Feb 20, 2010, 5:22 PM
  5. Replies: 3
    Last Post: Feb 02, 2010, 6:32 PM

Posting Permissions