Itemupdating called twice


Most of the Share Point developer has faced this issue, “Custom event receiver fires twice for Item Updating and Item Updated event in Document Libraries”.Actually it’s not an issue; this is default behavior of Share Point 2010 Document Libraries.This happens only at the time of uploading file in to library.I have explained the scenario below So, the custom event fires twice only at the time of uploading file into library.



So the double-event firing isn’t a bug, it’s just a result of the automatic check-in that occurs when you first add a document to a document library.This code is using the Before Properties and After Properties on the properties parameter to see what the value of the vti_sourcecontrolcheckedoutby property on the item was before the update occurred, and what it will be after the update has completed.The vti_sourcecontrolcheckedoutby property identifies who the item is currently checked-out to.As such, if the item is being checked-in, the Before Properties will contain a value for the property and the After Properties will not.

It’s a pretty simple fix, but we can definitely make it a bit more reusable for everyone on a development team and reduce the hassle of having to remember the specifics about how to run the check in their Item Updating and Item Updated event handlers.

Here I would show how to add a list (that you already have in your site), on your page for your web.