The security validation for this page is invalid or has timed out error in SharePoint 2010

This SharePoint tutorial, we will discuss how to solve the security validation for this page is invalid error and also we will discuss how to resolve The security validation for this page has timed out error in SharePoint 2010/2013.

Also, we will see how to use FormDigest control in SharePoint 2010/2013.

The security validation for this page is invalid SharePoint

For reasons of security, by default, Microsoft SharePoint Foundation does not allow you to make posts from a Web application to modify the contents of the database unless you include security validation on the page making the request.

But you can update data for a single site or for a site collection by adding a page directive and a FormDigest control to the page that makes the request.

For this we need to do 2 things:

1st:

Register the SharePoint web controls assembly in your aspx like below at top of the .aspx page:
<%@ Register TagPrefix=”SharePoint” Namespace=”Microsoft.SharePoint.WebControls”
Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>

2nd:

Place the FormDigest control on the .aspx page like below:
<sharepoint:formdigest id=”FormDigest1″ runat=”server” />

Through code also we can do this like below:

using Microsoft.SharePoint.Utilities

protected override void OnInit(EventArgs e)
{
if (Page.IsPostBack)
SPUtility.ValidateFormDigest();
base.OnInit(e);
}

The security validation is specific to a user, site, and time period and expires after a configurable amount of time. When the user requests a page, the server returns the page with security validation inserted. When the user then submits the form, the server verifies that the security validation has not changed.

The security validation for this page has timed out error in SharePoint 2010

Now, we will see how to resolve The security validation for this page has timed out. Click Back in your Web browser, refresh the page, and try your operation again.

Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SharePoint.WebPartPages.WebPartPageUserException: The security validation for this page has timed out. Click Back in your Web browser, refresh the page, and try your operation again.

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.

Solution:
I tried the below solution and it works for me:

First, open the SharePoint 2010 central administration and then from the Application Management section, Click on Manage web applications. This will open the Web applications list page.
Select the particular web application and click on General Settings from the Ribbon.

This will open the Web Applications General Settings dialog box.

From there Web page Security Validations property, Change the Security validations expires which is by default 30 minutes to Never as shown in the figure below:

The security validation for this page has timed out
The security validation for this page has timed out

You may like following SharePoint tutorials:

Hope this SharePoint tutorial helps how to resolve The security validation for this page is invalid and The security validation for this page has timed out error in SharePoint 2010/2013.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

  • Bijay, thanks for the post. I am running SP2013 on prim. Since I am working on a product farm, do I need to do an IISreset on the WFE servers for this change to take effect?

  • >