Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.






SharePoint: The security validation for this page is invalid

Another day, another lesson. This time I struggled with the following error: “The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.” This error occurs when you are on a custom form and try to save list item. I am sure that one can find many more scenarios where this error occurs. As usual, log contains error but not information.


NB! This blog is moved to

Click here to go to article


Brian Culver said:

You are the man.  This worked quite well.  I appreciate the information.

# June 3, 2009 4:50 AM

Jagadeeshwar M said:

Thank you very much ..

It worked quite well. Very good info, thanks again for sharing.. keep it up.

# December 19, 2009 12:33 PM

Sohel Rana said:


I have faced the same problem and setting the allowunsafeupdate true the error message gone away. the error was thrown when an update operation is done with wcf service (deployed in sharepoint).

# April 18, 2010 8:24 AM

Andrew Maisey said:

Make sure you are instantiating a new web from an SPWeb object itself and not SPWeb.Webs["WebName"].Add since this will fail. You will need to have full SPWeb context and maybe need to set AllowUnsafeUpdates on the SPWeb and SPSite as well as manipulating the form digest settings.

# May 21, 2010 6:00 AM