Asp.net Validation of viewstate MAC failed

前端 未结 16 1671
猫巷女王i
猫巷女王i 2020-12-02 20:12

I am receiving the following error at certain times on asp.net website.

 Sys.WebForms.PageRequestManagerServerErrorException: 
 Validation of viewstate MAC f         


        
16条回答
  •  误落风尘
    2020-12-02 20:57

    This solution worked for me in ASP.NET 4.5 using a Web Forms site.

    1. Use the following site to generate a Machine Key: http://www.blackbeltcoder.com/Resources/MachineKey.aspx
    2. Copy Full Machine Key Code.
    3. Go To your Web.Config File.
    4. Paste the Machine Key in the following code section:
        
          
            
          
         
    

    You should not see the viewstate Mac failed error anymore. Each website in the same app pool should have a separate machine key otherwise this error will continue.

提交回复
热议问题