Thursday, March 22, 2012 4:32 PM
In a sharepoint 2010 page, I added two different custom Web Part that we developped.
I am getting this error when I submit the custom properties form :
System.Web.HttpException: 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.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[ViewStateException: Invalid viewstate. Client IP: ::1 Port: 50786 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Any idea how to prevent this ?
Monday, March 26, 2012 7:49 AMModerator
Monday, March 26, 2012 8:33 AM
Adding enableViewStateView= false doesn't work.
The error occurs when I submit a custom propertie included in a ToolPart class that I developped. The property in cause is a PeopleEditor.
In this PeopleEditor, if I submit an empty field, there is no error. But if I select an existing user then submit the form, I have the error : System.Web.HttpException: Validation of viewstate MAC failed...
Monday, March 26, 2012 2:05 PM
This problem and its work-arounds are related in some articles :
I removed the property DataKeyNames in the gridViews included in the Web Part. I don't have the error anymore.
- Marked As Answer by Zino_o Monday, March 26, 2012 2:06 PM