Friday, May 15, 2009

Event Handler exceptional behaviour

Scenario:
Programming events can cause exceptional behaviors, depending on the contexts in which you implement the event handlers. The following table describes event behaviors related to specific contexts that you might encounter when writing code.

Few known behaviour:

1. A request to delete an item through a list form does not have an associated content type ID, but this causes an ItemDeleting or ItemDeleted event to fire on all items, not just on items of a specific content type, even though the event was registered only for the content type.

2. The BeforeProperties property applies only to DocumentLibrary type lists.

3. List events do not fire on the UserInfo list.

4. Event handlers will not fire when bulk operation is occurring. For example, when a new list is created, the FieldAdding event will not fire.

5. Using element file to register an event handler attaches it to all the list of particular type. Most of the requirements need event handler to be attached to a particular list which can only be done through code.

Article:
MSDN

Event Handlers- Everything you need to know

0 comments: