You must Sign In to post a response.
  • Category: ASP.NET

    Viewstate mac failed error in

    How to resolve View state mac failed error while posting data to server.
    Please provide a solution.
    some times it works fine but other is giving the error
  • #768298

    There are few things you need to validate from your side.

    #1 Check in the Web.Config file whether the Viewstate is in false.

    <pages enableViewStateMac="False" />

    #2 if the above point is fine, then now check the machine config in the same file. It should have Decryption key

    validationKey="" decryptionKey="" validation="SHA1? decryption="AES" />

    Kindly let us know if still issue exists after the correcting above points.


  • #768300
    You need to check both options
    [1] Either Disable ViewStateMac equal to false. For this issue
    <pages enableViewStateMac="False" /></system.web>

    [2] Configure MachineKey in Web.config
    You can resolve View state mac failed error issue with add given code snippet in your web.config file under <system.web>
     <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1" decryption="Auto>

  • #768332
    Do you have many controls on ? this problem occur when there are number of controls exist on single aspx page it is unable to handle the issue. So 'Invalid view state' exception thrown by system
    To resolve this we need to put following tag in web.config

    <pages enableViewStateMac="False" />

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • Sign In to post your comments