C# – Recursive SharePoint Event Handers

cevent handlingsharepoint

I've got an Event Receiver for when a list item is Updated (ItemUpdated and not ItemUpdating). Inside the receiver I then update the list item again. This naturally sets off some recursive event calls as I would expect. Putting a break point at the start of the event handler, I count it stoppping in the event 10 times and then it just finishes. Might there be some sort of recursion protection inside SharePoint exactly to protect against this sort of thing?

Best Answer

Use the DisableEventFiring Method

base.DisableEventFiring();
item.update();
base.EnableEventFiring();

Related Topic