此网页的安全性验证无效并且可能损坏

Microsoft.SharePoint.SPException: 此网页的安全性验证无效并且可能损坏。请单击 Web 浏览器中的“后退”,刷新网页,再重试操作。 ---> System.Runtime.InteropServices.COMException (0x8102006D): 此网页的安全性验证无效并且可能损坏。请单击 Web 浏览器中的“后退”,刷新网页,再重试操作。 在 Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateMembers(String bstrUrl, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bSendEmail) 在 Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bSendEmail) --- 内部异常堆栈跟踪的结尾 --- 在 Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bSendEmail) 在 Microsoft.SharePoint.SPRoleAssignmentCollection.RemoveMembers(Int32[] IdsToRemove, Int32 roleId) 在 Microsoft.SharePoint.SPRoleAssignmentCollection.RemoveMember(Int32 id) 在 Microsoft.SharePoint.SPRoleAssignmentCollection.Remove(Int32 index) 在 ASP._layouts_ealend_aspx.updatePermission(SPListItem cItem) 位置 c:"Program Files"Common Files"Microsoft Shared"web server extensions"12"TEMPLATE"LAYOUTS"eaLend.aspx:行号 213

                //取消继承
                if (!cItem.HasUniqueRoleAssignments)
                    cItem.BreakRoleInheritance(true);
                //清除权限
                while (cItem.RoleAssignments.Count > 0)
                {
                    cItem.RoleAssignments.Remove(0);//错误行
                }

 出现错误应该是权限问题,但是我已经

                     cSite.AllowUnsafeUpdates = true;
                    cWeb.AllowUnsafeUpdates = true;

最后,改成这样就不报错了

                //取消继承
                if (!cItem.HasUniqueRoleAssignments)
                    cItem.BreakRoleInheritance(true);
                //清除权限
                while (cItem.RoleAssignments.Count > 0)
                {
                    cSite.AllowUnsafeUpdates = true;
                    cWeb.AllowUnsafeUpdates = true;
                    cItem.RoleAssignments.Remove(0);
                    cSite.AllowUnsafeUpdates = false;
                    cWeb.AllowUnsafeUpdates = false;
                }

原文地址:https://www.cnblogs.com/liuzhengdao/p/1298018.html