Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPItemEventReceiver.ItemAdding method

Handles the synchronous event that occurs before an item is added.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public virtual void ItemAdding(
	SPItemEventProperties properties
)

Parameters

properties
Type: Microsoft.SharePoint.SPItemEventProperties

The properties of the event handler.

ExceptionCondition
ArgumentNullException

properties is null .

This event occurs in the following situations:

  • Default data is populated from a template.

  • New items are created using the browser user interface.

  • New items are added using the object model or Web service.

Caution noteCaution

When adding a new document to a document library, do not use the property setting Status=CancelNoError to cancel this event, since doing so redirects the user to the "File not found" error.

Show:
© 2015 Microsoft