Receivers Element (Event)

Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Contains the description of an event receiver for handling item events in lists created through the specified list template.

Definition

<Receivers
  ListTemplateId = "Text"
  ListTemplateOwner = "Text"
  ListUrl = string
  RootWebOnly = TRUE | FALSE
  Scope = Site | Web>
</Receivers>

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

**ListTemplateId**

Optional **Text**. Specifies the index of the list template to which the event receiver applies. For a list of the default list template types, see SPListTemplateType.

**ListTemplateOwner**

Optional **Text**. Specifies the GUID of the list template owner if the list template is registered through Features, or the name of the site definition if the list template is registered by a site definition.

**ListUrl**

Optional **string**. Specifies the URL of the list to which the event receiver applies.

**RootWebOnly**

Optional **Boolean**. **True** if the event receiver applies only to the root Web; otherwise, **False**.

**Scope**

Optional **enumeration**. The scope of the event receiver. This can be **Site** or **Web**. When the **Scope** attribute is set to **Site**, event receivers that are defined inside of a Feature that is scoped to the site collection are registered at the site collection level. When the **Scope** attribute is set to **Web**, event receivers that are defined inside of a Feature that is scoped to a Web are registered on the Web.

Child elements

Receiver

Parent elements

Elements

Occurrences

Minimum: 1

Maximum: Unbounded

Example

For an example of how this element is used, see Event Registrations.

A Receivers tag can imply a site-wide event registration or an event registration for the root Web. The Scope attribute is used to define at what level the event receivers are applied. If the Receivers tag has no ListTemplateId or ListUrl attribute, the event receiver is registered at the same scope as the Feature.

For example, a Feature that is scoped to the Web results in an event receiver being added to an event receiver collection that is scoped to the Web.