I am getting following error when I implement ItemUpdating event handler for a
List.
Server Error in '/' Application.
--------------------------------------------------------------------------------
You cann't update the list item
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: System.Runtime.InteropServices.COMException: You cann't
update the list item
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.
Stack Trace:
[COMException (0x81020089): You cann't update the list item]
Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String
bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean
bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid,
Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object&
pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties,
Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +0
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String
bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion,
Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId,
Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object&
pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean
bCheckin, Boolean bMigration, Boolean bPublish) +199
[SPException: You cann't update the list item]
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String
bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion,
Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId,
Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object&
pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean
bCheckin, Boolean bMigration, Boolean bPublish) +240
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) +933
Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean
bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish,
Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean
suppressAfterEvents) +182
Microsoft.SharePoint.SPListItem.Update() +89
Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext,
Boolean uploadMode, String checkInComment) +458
Microsoft.SharePoint.WebControls.SaveButton.SaveItem() +58
Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source,
EventArgs e) +249
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBa\
ckEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET
Version:2.0.50727.832
Code used for event handling:
public override void ItemUpdating(SPItemEventProperties properties)
{
properties.Cancel = true;
properties.ErrorMessage = "You cann't update the list item";
}
please help, am I missing any steps in implementation.