You get error “The Security validation for this page is invalid” when you try to add page or move a page. This error is due to Security validation error.
This error is caused due to security validation. One way to resolve this is to turn it off in Central admin.
Central Administration—>application management—->web application general settings–>turn security validation off
But, if we always keep it on there might be danger of malicious code.
So, we should handle this through coding, turn off security validation for our code to execute and then again turn it on.
SPWeb ospWeb = SPContext.Current.Web;
Microsoft.SharePoint.Administration.SPWebApplication webApp = ospWeb.Site.WebApplication;
webApp.FormDigestSettings.Enabled = false;
webApp.FormDigestSettings.Enabled = true;
using (SPSite site = new SPSite(“http://pathik01”))
site.AllowUnsafeUpdates = true;
using (SPWeb web = site.OpenWeb())
web.AllowUnsafeUpdates = true;
SPList list = web.Lists[“List1”];
list.Title = “some title”;
Setting the “AllowUnsafeUpdates” properties of both the SPSite and SPWeb objects to “true”, mostly will resolve this issue out if you are using a code similar to above within a webpart or an ASP.NET web application.