Validation of viewstate MAC failed - error

Discussion in 'ASP.NET / ASP.NET Core' started by mm2000, Jan 8, 2009.

  1. Hi,

    If I leave a page open for few hours and then either (1) hit refresh or (2) click on any link on that page, I get the error message:

    '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 get this error many times when I leave a page open and then navigate to a different page. Is there a way to prevent this mac validation error (via web.config file)?

    I have set 'enableviewstatemac=false' at page level, but it still doesnt help. Any suggestions?

    In addition, how do I ask the site to redirect to a error friendly page, instead of showing this entire error message to customers?

    Thanks,
    Maddy
     
  2. Bruce

    Bruce DiscountASP.NET Staff

Share This Page