Click to Rate and Give Feedback

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
SPItemEventReceiver.ItemAdding Method (Microsoft.SharePoint)
Synchronous Before event that occurs when a new item is added to its containing object.

Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
Public Overridable Sub ItemAdding ( _
    properties As SPItemEventProperties _
)
Visual Basic (Usage)
Dim instance As SPItemEventReceiver
Dim properties As SPItemEventProperties

instance.ItemAdding(properties)
C#
public virtual void ItemAdding (
    SPItemEventProperties properties
)

Parameters

properties

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.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
ItemAdding Does not allow access to the Item Properties      Luke_Adams   |   Edit   |   Show History
Just a heads up that ItemAdding Event Does NOT allow access to the Items Properties.
Tags What's this?: Add a tag
Flag as ContentBug
Accessing the Items Properties      Omar Damiani   |   Edit   |   Show History

ItemAdding, as all before events, has its Items properties in the AfterProperties collection.

NOTE: The ID is still unreachable, since the Item has not been created yet

Tags What's this?: Add a tag
Flag as ContentBug
Items proproperties are stored in AfterCollection collection      Martin Winzig   |   Edit   |   Show History

Only issue is that user don't see(values aren't enumerated) values stored in this collection during debuging. :)

Tags What's this?: Add a tag
Flag as ContentBug
Bug - event does not fire in Document Library      Martin Winzig ... SelviB   |   Edit   |   Show History
I have the same problem with event itemupdating
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker