18 04 2009
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.
For me it was enough to turn off form diggest settings.
// assign values to list item fields
var site = SPContext.Current.Site;
var digestSettings = site.WebApplication.FormDigestSettings;
var settingsEnable = digestSetting.Enabled;
digestSettings.Enabled = false;
digestSettings.Enabled = settingsEnable;
Hope it helps somebody.