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 127463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:28:50+00:00 2026-05-11T05:28:50+00:00

I’ve created an event receiver and have added to the GAC. How do I

  • 0

I’ve created an event receiver and have added to the GAC.

How do I bound an event receiver to a specific custom content type?

I need to do this from an XML file:

So far I have:

Feature.xml that points to an Elements.xml file but am not sure about the Elements.xml file.

How do you reference a specific content type? (I have the guid for the specific content-type)

  • 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. 2026-05-11T05:28:51+00:00Added an answer on May 11, 2026 at 5:28 am

    To bind an event receiver to a specific content type, you use the XmlDocuments element of the content type elements file. Here’s a rather exclusive excerpt from my upcoming book ‘Building the SharePoint User Experience’:

    And, just to clarify, since I don’t see the XML you tried to post, you would add this to the content type declaration in the elements.xml file.

    (…)

    Attaching event receivers to content types using features

    The important thing with attaching event receivers like we just saw is to notice that there is no way to bind a receiver to a content type, only to a list template.

    No, there are no ways to add receivers to individual lists either. However, as we saw in the Email enabling custom lists section in the Forest of lists chapter we can programmatically add event receivers using code. We can use the same technique to add event receivers to a content type as well, but there should be a way to do this using CAML in a feature. After all that is where we define the content type, as we will see later in the chapter.

    The answer? Event receivers in content types are defined in a different section of the elements file. Again we look to XmlDocuments and the third built-in XmlDocument type Receiver. The Receiver XmlDocument resides in the http://schemas.microsoft.com/sharepoint/events namespace. If you want to see a Receiver XmlDocument in your default SharePoint installation, search the ctypeswss.xml file for the content type 0x010107, the DocumentWorkflowItem:

    <XmlDocument NamespaceURI='http://schemas.microsoft.com/sharepoint/events'>  <spe:Receivers xmlns:spe='http://schemas.microsoft.com/sharepoint/events'>   <Receiver>    <Name>Workflow Library Item Added</Name>    <Type>ItemAdded</Type>    <SequenceNumber>1</SequenceNumber>    <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,~CCC     PublicKeyToken=71e9bce111e9429c</Assembly>    <Class>Microsoft.SharePoint.Workflow.SPWorkflowLibraryEventReceiver</Class>    <Data />    <Filter />   </Receiver> … (snipped for space saving purposes  </Receivers> </XmlDocument> 

    Note The example uses a prefix spe: for the Receivers element. This is not necessary from a technical point of view, but can add clarity to your code. As you can see, the Receiver element follows the structure of a regular item event receiver as defined in elements. Except, of course, that the receiver is defined in the XmlDocument section of the content type.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.