Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

Rate It (17)

Last post 02-03-2010 3:21 PM by micahsmith. 327 replies.

Sort Posts:

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-01-2007, 4:05 AM
    • Member
      6 point Member
    • projectstream
    • Member since 04-30-2007, 8:36 AM
    • Posts 3

    I can confirm that my post at 04-30-2007 10:14 AM has resolved the problem for me.

    WebSite Projects generate randomly named runtime assemblies and any types in these assemblies usually cannot be passed around servers in a Web Farm because the random names for the assemblies are different on each server.

  • Validation of viewstate MAC failed.

    05-16-2007, 6:29 PM
    • Member
      4 point Member
    • SJO.NET
    • Member since 05-28-2003, 6:12 PM
    • Sacramento County
    • Posts 2

     I wanted Microsoft to know about the problem we are having with this site.

    The error I'm getting is this: 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. 

    I have a very basic aspx page. I do not have any controls apart from some text boxes and just one form. I get this error when I leave the page idle for long. I do not think it occurs when session expires because I made the session timeout for 1 min, but still it occurs when I leave the page idle for more than 20 minutes... any clue whats going on?

    I have tried this in the web.config file:

          <system.web>

                <pages enableEventValidation="false" enableViewStateMac="false" viewStateEncryptionMode ="Never"  smartNavigation="false" />

    This works on our development machine (2003, IIS6 & .Net 2.0), but fails on our shared server (2003, IIS6 & .Net 2.0).

    Would like to find an answer soon.

    Steven

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-18-2007, 12:04 PM
    • Member
      2 point Member
    • Tikitiki
    • Member since 05-18-2007, 4:02 PM
    • Posts 1

    I had the same problem.

    In my case it was due to my web page containing two tags <form>

    Can you verify if you have more than one of these tags? if it's the case remove the redundant forms tags

    Regards
     

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-18-2007, 1:37 PM
    • Member
      4 point Member
    • SJO.NET
    • Member since 05-28-2003, 6:12 PM
    • Sacramento County
    • Posts 2

     

    I searched the form and only found one <form>.  Thanks for answering it though.
  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-21-2007, 1:23 AM
    • Member
      3 point Member
    • str999_cn
    • Member since 09-19-2006, 2:00 PM
    • Posts 6

    Hello, I already set the EventValidation as "false", the same exception still occurs. Why?

    <%@ page language="C#" autoeventwireup="true" inherits="Adimin_InputNews, App_Web_3otgz97f" validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" %>

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-24-2007, 10:03 AM
    • Member
      14 point Member
    • MarekG
    • Member since 10-09-2006, 1:50 PM
    • Posts 4

    What about an usercontrol with outputcache? I get this every time when clicking button (which posts back to another page) inside cached user control.

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-24-2007, 4:52 PM
    • Member
      10 point Member
    • ytkaczyk
    • Member since 05-19-2007, 9:34 PM
    • Posts 5

    I am getting the same error. I am using ASP.NET with AJAX. I have one update panel on the page and EnablePartialRendering is set to true in the script manager. What is interesting is that this only seem to happen with IE and after the session times out. Setting the maxPageStateFieldLength solves the problem but I am not very confortable with it because it is not a good explanation of why it is solving it. Can anybody give me some confort as to why this would work?

     Thank you,

     Yves

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    05-31-2007, 7:22 AM
    • Member
      736 point Member
    • zirmandli
    • Member since 05-22-2007, 5:45 AM
    • Ahmedabad, India
    • Posts 108

    I changes the Page Attribute but didnt succeed.

    I am still getting the same error when my system remains idle for 30-35 minutes,

    so ultimately session expires and while clicking on any link of the page it doesnt redirect to guest console, but instead it crashes application and throws this error

    Please Help me ... 

    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.

    Click on 'Mark as Answer' if this post is helpful.

    -- Benazir Mandli
  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    06-05-2007, 11:58 PM
    • Member
      56 point Member
    • shahDeveloper
    • Member since 03-22-2007, 3:52 PM
    • PAKISTAN
    • Posts 35

    i have the same problem,i done all the instructions givrn in this forum topic but the problem remain the same that no event of linkbuttons or buttons called and mac fac error ocurrrrrrrrreeeeeeeeee.plzzzz help its urgant

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    06-08-2007, 1:28 PM
    • Member
      2 point Member
    • Howdy Doody
    • Member since 06-08-2007, 5:15 PM
    • Posts 1

    Howdy, 

    Yee Haw, I got mine fixed ....

    "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 valiation algorithm. Auto Generate cannot be used in a cluster."

    Im Using:  Web Devoloper Express 2005 Ver 8.0.50727.762,  ASP.NET 2.0 ver 2.0.50727 , AJAX 1.1, SQL Server 2005 Express.

    My Code:  Im using AJAX placeholder to contain another placeholder that dynamically loads web user controls.  What was causing my error was a gridview bound to a Object Data Source placed on a web user control that was loaded into the placeholder.  I was getting this error locally not using IIS.

    Fix 1:  Removing the AJAX placeholder fixed it.  (But I really wanted to use AJAX).

    Fix 2:  By turning the gridview property "AutoGenerateColums" property to TRUE.  Then it worked fine.  When it was set to FALSE (so I could customize my grid) it causes the error.  I'm still trying to figure out a way to get the columns I need to not show with this.  

    EDIT:  And here is another fix.  (I don't know how I missed this earlier while searching)

    http://aspadvice.com/blogs/joteke/archive/2006/02/02/15011.aspx

    Basically setting "<pages enableEventValidation="false" viewStateEncryptionMode="Never" enableViewStateMac="false"/> " on my page in the AJAX handler fixed this.  Now I just need to read up on the security precautions with it.

     My appologies if this was mentioned somewhere earlier and I missed it.

    HTH, 

    Doody

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    06-12-2007, 10:13 AM
    • Member
      195 point Member
    • dsorrell
    • Member since 03-21-2007, 3:48 PM
    • Massachusetts
    • Posts 67

    I fought with this problem for about five hours yesterday, and the maxPageStateFieldLength seems to be working... unfortunately, we just had a website encounter the same issue, and it's .NET 1.1, which doesn't have that particular field. Does anyone know of a good 1.1 fix? 

    There are some who call me......................................Dave?

    Why do the good citizens of this forum seem to enjoy overcomplicating every little problem? There is beauty and elegance to simplicity. Learn it.
  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted(use this finall web config have ajax toolkit toooo)

    06-14-2007, 8:38 AM
    • Member
      56 point Member
    • shahDeveloper
    • Member since 03-22-2007, 3:52 PM
    • PAKISTAN
    • Posts 35
    <?xml version="1.0"?>

    <configuration>

    <configSections>

    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />

    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />

    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />

    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />

    </sectionGroup>

    </sectionGroup>

    </sectionGroup>

    </configSections>

    <appSettings>

    </appSettings>

    <system.web>

    <customErrors mode="Off" />

     

    <
    pages enableViewStateMac="false" viewStateEncryptionMode="Never" enableEventValidation="false" >

    <controls>

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    </controls>

    </pages>

    <machineKey validation="SHA1" decryption="AES" validationKey="21986A8BD360911A892ADA3AB237832E21951205D7802BF2B49FBFE9D0C5A41C451E518A23518D189493F727F2E138E73EE7E9B1F884563232B755FF41F1C8" decryptionKey="A9C0435F27C40E840A4D9DFE41BC8A669B29F592E4C4C24539A35BD41697EBEA" />

    <compilation debug="true" strict="false" explicit="true">

    <assemblies>

    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    </assemblies>

    </compilation>

    <httpHandlers>

    <remove verb="*" path="*.asmx" />

    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />

    </httpHandlers>

    <httpModules>

    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    </httpModules>

    </system.web>

    <system.web.extensions>

    <scripting>

    <webServices>

    <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->

    <!--

    <jsonSerialization maxJsonLength="500">

    <converters>

    <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>

    </converters>

    </jsonSerialization>

    -->

    <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->

    <!--

    <authenticationService enabled="true" requireSSL = "true|false"/>

    --><!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved

    and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and

    writeAccessProperties attributes. -->

    <!--

    <profileService enabled="true"

    readAccessProperties="propertyname1,propertyname2"

    writeAccessProperties="propertyname1,propertyname2" />

    -->

    </webServices>

    <!--

    <scriptResourceHandler enableCompression="true" enableCaching="true" />

    -->

    </scripting>

    </system.web.extensions>

    <system.webServer>

    <validation validateIntegratedModeConfiguration="false" />

    <modules>

    <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    </modules>

    <handlers>

    <remove name="WebServiceHandlerFactory-Integrated" />

    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    </handlers>

    </system.webServer>

    </configuration>

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted(use this finall web config have ajax toolkit toooo)

    06-15-2007, 3:44 PM
    • Member
      2 point Member
    • oggok
    • Member since 12-23-2006, 9:58 PM
    • Posts 3

    I fixed this problem.

     It appears I have one aspx file calling another aspx file with Server.Execute (I was mergin content from two pages). Since both aspx files have "form" tags, resulting page would contain 2 form tags and this was the reason for error.

    After I removed call to Server.Execute the problem gone.

    Sleeping Dude

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    06-18-2007, 9:55 AM
    • Member
      52 point Member
    • gdogg
    • Member since 03-15-2006, 9:02 PM
    • Posts 39

    I built a webform with an ajax timer on it that fires every 1 second.  This worked great, no issues whatsoever in IE and FireFox, BUT my boss just downloaded the new Safari Beta3 for Windows and I keep getting this error: "Validation of ViewState Mac failed".  Did some searching and found this page: http://aspadvice.com/blogs/joteke/archive/2006/02/02/15011.aspx (which loops back to this thread)

    The suggestion in the post actually did not work for me, i had to go the extra step posted by one of the commenters and an additional value:

     <pages enableEventValidation="false" viewStateEncryptionMode="Never" enableViewStateMac="false" />

     

    I then played around with it, and was able to remove the viewStateEncryptionMode value.  I dont have any data controls on my page, so I am a little confused as to why this is happening, and also why is it only happening in Safari Beta3 for Windows.  Safe to blame a beta product?

  • Re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

    06-20-2007, 2:16 AM
    • Member
      32 point Member
    • ibram
    • Member since 06-20-2007, 6:10 AM
    • Mainz, Germany
    • Posts 13

    May be it is a little bit tricky, but it might be possible to disable the buttons after the first click. It should work by adding the javascript event onclick which calls a function that disables the button. So the impatient user won't get the chance to click again. I will try this.

Page 9 of 22 (328 items) « First ... < Previous 7 8 9 10 11 Next > ... Last »