SPEventReceiverBase..::.DisableEventFiring Method

[This documentation is preliminary and is subject to change.]

NOTE: This API is now obsolete.

Prevents events from being raised.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax

Visual Basic (Declaration)
<ObsoleteAttribute("Use EventFiringEnabled")> _
Protected Sub DisableEventFiring
Visual Basic (Usage)
Me.DisableEventFiring()
C#
[ObsoleteAttribute("Use EventFiringEnabled")]
protected void DisableEventFiring()
Remarks

One reason to prevent events from being raised is to avoid recursion. For example, if you have an ItemAdded event on a list and you write code within it to add an item, you can put that code in a DisableEventReceivers() ... EnableEventReceivers() block to avoid recursion.

See Also

Reference

Tags :


Page view tracker