2

Hi I have a event receiver(item adding,item editing,item added), it was working fine before ...now it has started to fire twice...any suggestions?

7

In my case it was accidentally doubled registration of event reciever. Check it with SharePoint Manager 2010 for example.

4

Before you call update on the item in your receiver, are you calling this.DisableEventFiring() and then this.EnableEventFiring() straight after?

  • Hi James, i am not calling any of those?...do u have to mention them? – spStacker Feb 14 '12 at 19:39
  • 2
    If you are updating your item within your event receiver you would want to use these because otherwise the Update call will trigger another Updating/Updated event to fire. – SpartanDonut Feb 14 '12 at 20:15
1

Here's an article on the subject from Simple-Talk - Managing ItemUpdating and ItemUpdated Events Firing Twice in a SharePoint Item Event Receiver. Well worth reading.

1

I had the same problem this week when I wanted to publish a page directly from the "Publish" ribbon button.

My event receiver fired three times in a row. The first time for the check in, The second time for the publication, and the last time to approve it.

What I dit was checking the afterproperties, to see if I will get the correct values. I did not find another solution.

If you are updating your item in the event receiver, than you could try James Love his solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.