Pages

Showing posts with label The security validation for this page is invalid. Click Back in your Web browser. Show all posts
Showing posts with label The security validation for this page is invalid. Click Back in your Web browser. Show all posts

Monday, July 20, 2009

Error while updating SharePoint list, “The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again”

This error "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again" is very common for beginners SharePoint developer, who start developing and digging into SharePoint object model, it’s coming while updating SharePoint list, the cause of error is due to security rights, if we make web.AllowUnsafeUpdates = true and then update the SharePoint list then we won’t get above error.

Sample Code:

Web.AllowUnsafeUpdates = true;
item["Title"]=”Sample”;
item.Update();

Happy Coding !!