1

I am having an issue with my "add file" control in InfoPath. When I preview the InfoPath form it works fine; however, when I publish the form to the SharePoint site (browser enabled) I get an error when I try to upload an attachment in the form.

I am using InfoPath 2010 and SharePoint 2010. I have never had this issue before.

The error I get is:

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

2 Answers 2

0

This can be caused by having anonymous access enabled on a site as well as another form of authentication, or from having checked out a document prior to authenticating to the SharePoint site, or from not having the appropriate permissions to update the list item (or document in a library).

The first thing I would try is to validate your permissions.

If that does not resolve the issue, Shantha Kumar suggests setting Web.AllowUnsafeUpdates = true; or web.Site.WebApplication.FormDigestSettings.Enabled = false; before updating the item. If the second method is used it needs to be reset to true after the list item is updated.

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

Also, see June 2011 CU Woes – Workaround for InfoPath forms error which suggests to add <SharePoint:FormDigest runat="server" /> in the body of FormServer.aspx in the LAYOUTS folder of the 14 hive.

Hope this helps.

0

Try to make this changes SPWebapplication.FormDigestSettings.Enabled = false to turn off the digest setting property for the web application?

The root cause of this issue and solutions are as below:

The above error will be thrown at the time of updating Library or Lists items due to authentication problem, or We didn’t have the rights to update the items. By using the following code, We can overcome this issue:

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

OR

we can also use the follwoing code to overcome the above error, this will affect the WebApplication. This will change the Security settings of a Web Application to allow the anonymous user to update item.

web.Site.WebApplication.FormDigestSettings.Enabled = false;
item[“Title”]=”Sample”;
item.Update();
web.Site.WebApplication.FormDigestSettings.Enabled = true;

OR

We can change the settings in Central Administration to anonymously update the items. But this method will be dangerous.

Central Administration > Application Management > Web Application General Settings Choose the WebApplication to overwrite the settings Select the option Off in Web Page Security Validation as follows,

enter image description here

For detailed please refer the below article:

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

The security validation for this page is invalid – Infopath 2010

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.