Share via


EventReceiver Element (DeploymentManifest)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Represents a SharePoint event receiver object instance (SPEventReceiverDefinition). Depending on the event receiver collection specified, the event receiver can listen for events on SPFile, SPList, SPListItem, or SPWeb objects.

DECLARATION
<xs:element name="EventReceiver" 
        type="SPEventReceiverDefinition" 
        minOccurs="0" maxOccurs="unbounded" 
/>

USAGE
<EventReceivers>
        <EventReceiver
                Id="Guid"
                Name="xs:string"
                WebId="Guid"
                HostId="Guid"
                HostType="SPEventHostType"
                Type="SPEventReceiverType"
                SequenceNumber="xs:int"
                Assembly="xs:string"
                Class="xs:string"
                Data="xs:string"
                Filter="xs:string"
                Credential="xs:int"
                ItemId="xs:int"
        />
</EventReceivers>

Type

SPEventReceiverDefinition

Attributes

Attribute

Type

Description

ID

Guid Simple Type (DeploymentManifest)

Required. Unique identifier of the event receiver definition.

Name

xs:string

Required. Name of the event receiver.

WebId

Guid Simple Type (DeploymentManifest)

Required. Unique identifier of the site in which the event receiver is registered.

HostId

Guid Simple Type (DeploymentManifest)

Required. Unique identifier of the object that is hosting the event.

HostType

SPEventHostType Simple Type (DeploymentManifest)

Required. Type of object that is hosting the event. The host type must be an enumeration value defined in the SPEventHostTypesimple type.

Type

SPEventReceiverType Simple Type (DeploymentManifest)

Required. Type of event for the event receiver. The event receiver type must be an enumeration value defined in the SPEventReceiverType simple type.

SequenceNumber

xs:int

Required. Integer representing the relative order in a sequence of events.

Assembly

xs:string

Required. Strong name representing the assembly that is the event receiver.

Class

xs:string

Required. The class that is the event receiver.

Data

xs:string

Optional. Data that is associated with the event receiver.

Filter

xs:string

Optional.

Credential

xs:int

Optional.

ItemId

xs:int

Optional.

Child Elements

None

Parent Elements

EventReceivers Element (DeploymentManifest - SPFile)

EventReceivers Element (DeploymentManifest - SPList)

EventReceivers Element (DeploymentManifest - SPListItem)

EventReceivers Element (DeploymentManifest - SPWeb)

See Also

Reference

SPEventReceiverDefinition

Concepts

DeploymentManifest Schema