After we install the Microsoft IT SharePoint 2010 Site Recycle Bin previous named Site Delete Capture tool has been released from CodePlex. We had issue when creating our sites using customized site definition with Site Recycle Bin features activation. We noticed the below error in the log file, which saying the error while activating Site Recycle feature but the real issue is with customized feature after site created.
“Failed to activate feature 'SiteRecycleBinSiteFeature' (Id 78b94e15-23ce-43f9-8036-babd847497d1) associated with site template 'QUALCOMMDEPT#1' at scope \"http://sbx01:80/sites/Harry1/ww/pp\". Exception: Microsoft.SharePoint.SPException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again”
The customized feature after site creation will setup groups w/ unique permissions, enabled auditing on Document library, add portal connection URL, add some content types, disable designer setting, and setup search setting. The feature code looks like as following:
web.AllowUnsafeUpdates = true;
if (web.IsRootWeb)
{
SPSite SiteCol = web.Site;
CreateGroupPermisions(web);
CreateAuditSettings(SiteCol);
CreatePortalSettings(SiteCol);
AddContentTypetoDocsLibs(web, "Shared Documents", "Link to a Document");
CreateDesignerSettings(web.Site, false, false, false, false);
CreateSearchSettings(web.Site);
}
web.Update();
web.AllowUnsafeUpdates = false;
We found other developers have reported similar issues and here is the solution they recommend to resolve it.
Add the following two lines besides AllowUnsafeUpdates = true.
//Disabling the from digest :-
SPWebapplication.FormDigestSettings.Enabled = false;
//Your original code listed above here
//Enabling the from digest :-
SPWebapplication.FormDigestSettings.Enabled = true;
This way you should resolve the "The security validation for this page is invalid." SPException.
No comments:
Post a Comment