2

I’m trying to override the ItemAdded event handler for a Sharepoint 2007 document library. For some reason, it appears that the ItemAdded event is not firing. I can override the ItemAdding event no problem.

    override void ItemAdding(SPItemEventProperties properties)
    {
        Log("Item Adding");
    }

    override void ItemAdded(SPItemEventProperties properties)
    {
        Log("Item Added");
    }

When I check the log file, I see “Item Adding”, but not “Item Added”. I know ItemAdded is asynchronous, so I’ve waited a few minutes, and tried refreshing, but no luck. Any idea what could be happening?

2

You should check if the event ItemAdded is really attached to the document library. Something like the following should do the trick :

listName.EventReceivers.Add(SPEventReceiverType.ItemAdded, Assembly.GetExecutingAssembly().FullName, typeof(YourItemReceiverClass).FullName);

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.