Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6581631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:10:39+00:00 2026-05-25T16:10:39+00:00

I am trying to create an event receiver for a list I have created

  • 0

I am trying to create an event receiver for a list I have created called Questions.

When a new question is added I want an event to fire. I have looked into it so I know I need to create an event receiver and make use of the ItemAdded method.

How do I bind this to one instance of a list and what do I select for the Source type when creating the receiver? I don’t have an option for “Custom List” in there as some blog posts suggest.

Hope someone can help..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:10:40+00:00Added an answer on May 25, 2026 at 4:10 pm

    I think this might be what you’re after: (http://msdn.microsoft.com/en-us/library/ff407249.aspx)

    using (SPSite site = new SPSite("http://localhost")) 
    {
        using (SPWeb web = site.OpenWeb())
        {
            SPList list = web.Lists["Shared Documents"];
    
            SPEventReceiverDefinition def = list.EventReceivers.Add();
    
            def.Assembly = "ERDefinition, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=704f58d28567dc00";
            def.Class = "ERDefinition.ItemEvents";
            def.Name = "ItemAdded Event";
            def.Type = SPEventReceiverType.ItemAdded;
            def.SequenceNumber = 1000;
            def.Synchronization = SPEventReceiverSynchronization.Synchronous;
            def.Update();
        }
    }
    

    Regards,

    joel

    —

    http://joelblogs.co.uk

    @joelblogs

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create new Event objects to be persisted in the database
Im trying to create an ajax (post) event that will populate a table in
I'm trying to catch a double-click event in a TreeView's empty area to create
I'm trying to creat special event for jQuery. I want to make controled delay,
i am trying to bind an event to a dynamically created div. function GameField(playerNumber)
I'm trying to create a list of events for an agenda. To do this,
Trying to use the new cleaner event handling in Knockout 2 along with the
I'm trying to create Command Buttons dynamically, but clicking the button in question doesn't
I have an example where I am trying to create an AJAX login using
I'm trying to create a feature to register my event handler to a specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.