博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

操作:在infopath按钮事件中对infopath文档所在列表项的用户权限进行修改
引发如下症状:
1、轻度症状:
此网页的安全性验证无效并且可能损坏。请单击 Web 浏览器中的“后退”,刷新网页,再重试操作。

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)
在 VehicleRequestForm.FormCode.<>c__DisplayClass1.<SaveData_Clicked>b__0()
在 Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state)
在 Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()
在 Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
在 Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
在 Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
在 VehicleRequestForm.FormCode.SaveData_Clicked(Object sender, ClickedEventArgs e)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.<>c__DisplayClass6.<>c__DisplayClassa.<add_Clicked>b__3()
在 Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.<>c__DisplayClass6.<add_Clicked>b__2(Object sender, ClickedEventArgs e)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.FireClickedEvent(Object sender, ClickedEventArgs args)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonFormCode.<>c__DisplayClass2.<>c__DisplayClass5.<Click>b__1()
在 Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d)


已向服务器的 Windows 事件日志中添加了一个条目。
日志 ID:5337

 医治:1、web.AllowUnsafeUpdates = true;
          (如果第一条仍然无效)2、禁用相关的web应用的安全验证状态

2. 重度症状,几尽无救

 对象的当前状态使该操作无效。

System.InvalidOperationException: 对象的当前状态使该操作无效。
在 Microsoft.SharePoint.WebControls.SPControl.SPWebEnsureSPControl(HttpContext context)
在 Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(HttpContext context)
在 Microsoft.SharePoint.SPContext.get_Current()
在 Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents)
在 Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents)
在 Microsoft.SharePoint.SPListItem.Update()
在 VehicleRequestForm.FormCode.<>c__DisplayClass1.<SaveData_Clicked>b__0()
在 Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state)
在 Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()
在 Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
在 Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
在 Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
在 VehicleRequestForm.FormCode.SaveData_Clicked(Object sender, ClickedEventArgs e)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.<>c__DisplayClass6.<>c__DisplayClassa.<add_Clicked>b__3()
在 Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.<>c__DisplayClass6.<add_Clicked>b__2(Object sender, ClickedEventArgs e)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.FireClickedEvent(Object sender, ClickedEventArgs args)
在 Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonFormCode.<>c__DisplayClass2.<>c__DisplayClass5.<Click>b__1()
在 Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d)

已向服务器的 Windows 事件日志中添加了一个条目。
日志 ID:5337
在某台万恶的服务器上,暂时还找不到能有效医治的解药:(