Domanda

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?

È stato utile?

Soluzione

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

Altri suggerimenti

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

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.

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top