I highly recommend you use the online tool. This is the preferred method.Ī) Either build your own Key Generator ( ) or use this tool ( ). This approach is not 100% secure.ģ) Configure ASP.NET to not use Auto-Generated Key but rather a predefined key. There are several ways to get around this problem:ġ) Host your site on a server that never restarts or recycles!!! Obviously, this is impossible!Ģ) Disable ViewstateMac by putting this ?enableViewStateMac='false'? in your web.config. Since the key is different, ASP.NET will not be able to decrypt the viewstate and it will throw the above error. The problem comes when a client (browser) sends the request with a viewstate encrypted with the key generated by another worker process. By default, ASP.NET encrypts the viewstate using an Autogenerated Key when the process spins up. This error is usually caused by the asp worker process or the server recycling. We have been getting some questions regarding viewstate-related errors like 'The viewstate is invalid for this page and might be corrupted'