Eventhandler in SharePoint 4: Compile event handler for content type

Source: Internet
Author: User

In the previous section, we created the companyitemeventaggreger class to use uppercase letters in company names to maintain data integrity. as the last part of the event handler er series, we want to demonstrate how to bind event handler in the event handler er class to the content types of company. this is done by using an inner xmldocument node in content type definition. The following is an example. you can see that each event handler must be bound with the same information separately.

 

<ContentType ID="0x0100E71A2716C18B4e96A9B0461156806FFA" Name="Company" >  <!-- FieldRefs element omitted for clarity -->  <!-- event handlers added to content type using XmlDocument element -->  <XmlDocuments>    <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">      <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">        <spe:Receiver>          <spe:Name>ItemAddedReceiver</spe:Name>          <spe:Type>ItemAdded</spe:Type>          <spe:Assembly>LitwareTypes, [full 4-part assembly name] </spe:Assembly>          <spe:Class>LitwareTypes.CompanyItemEventReceiver</spe:Class>        </spe:Receiver>        <spe:Receiver>          <spe:Name>ItemUpdatedReceiver</spe:Name>          <spe:Type>ItemUpdated</spe:Type>          <spe:Assembly>LitwareTypes, [full 4-part assembly name] </spe:Assembly>          <spe:Class>LitwareTypes.CompanyItemEventReceiver</spe:Class>        </spe:Receiver>      </spe:Receivers>    </XmlDocument>  </XmlDocuments></ContentType>

Translated from:

Inside Microsoft Windows SharePoint Services 3.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.