SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like to set permission for listitem customlly.But ItemAdded is not firied for listitem. Plz help me

share|improve this question
Please elaborate your question, might be can help you better. – Anuja Oct 26 '12 at 8:20
Thanx for ur reply...Event handler is not fired for Item Added. – varna Oct 26 '12 at 8:23
Plz help me.... – varna Oct 26 '12 at 8:24

First of all please Download Sharepoint Manger and check if event receiver attached to list or not.

if it is attached properly, in few rare instances where the event handler is not firing.

Does it related to SharePoint timer services or something else?

here is the way you can add event receiver through code.

private void AddEventReceiverToList(string siteUrl, string listName, string className,    string AssemblyFullName)   
using (SPSite site = new SPSite(siteUrl))
using (SPWeb web = site.OpenWeb())   
        SPList list = web.Lists[listName];   
        if (list != null)   
            int receivers = list.EventReceivers.Count;    
            web.AllowUnsafeUpdates = true;   
            bool isAddedReceiverExist = false;   
            for (int i = 0; i < receivers; i++)   
                SPEventReceiverDefinition eventReceiver = list.EventReceivers[i];   
                if (eventReceiver.Class == className &&  eventReceiver.Type == SPEventReceiverType.ItemAdded)   
                    isAddedReceiverExist = true;   
            if (!isAddedReceiverExist)   
                  list.EventReceivers.Add(SPEventReceiverType.ItemAdded, AssemblyFullName, className);   
    catch(Exception exc)
        //magic here
        web.AllowUnsafeUpdates = false;   


AddEventReceiverToList("http://spsite-test:231/TestOMatic", "EventReceiverClassName",  "EventReceiverAssemblyName, Version=, Culture=neutral, PublicKeyToken=a865f0ecc234ea51");
share|improve this answer
i download Sharepoint to check event receiver is attached to list or not using SharePoint Manager – varna Oct 26 '12 at 8:39
you can run SharePoint Manager on your SharePoint server (make sure you do a 'run as administrator' for the first time), then just navigate to your appropriate list, and open up event receivers. It will display everything attached. – Anuja Oct 26 '12 at 8:48
ya i checked by Sharepoint manager....but nothing in the EventReceivers.Wht i have to do now??? – varna Oct 26 '12 at 9:03
That means your event is not attached to the specific list. you can add eventreceiver by code to, i have edited my answer with code, please refer that – Anuja Oct 26 '12 at 9:08
i m creating custom list in the name Sample.And i created the Event Receiver for Item Added.Then what i have to do??? – varna Oct 26 '12 at 9:17

Your Answer


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.