Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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