Disable Event Firing anywhere SharePoint 2010


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class DisabledItemEventsScope : SPItemEventReceiver, IDisposable
  2. {
  3. bool oldValue;
  4.  
  5. public DisabledItemEventsScope()
  6. {
  7. this.oldValue = base.EventFiringEnabled;
  8. base.EventFiringEnabled = false;
  9. }
  10.  
  11. #region IDisposable Members
  12.  
  13. public void Dispose()
  14. {
  15. base.EventFiringEnabled = oldValue;
  16. }
  17.  
  18. #endregion
  19. }

URL: http://adrianhenke.wordpress.com/2010/01/29/disable-item-events-firing-during-item-update/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.