Sitecore 5.0 API

Item.MasterID Property

Gets the ID of the master that was used to create this item.

[Visual Basic]
Public Property MasterID As ID
[C#]
public Sitecore.Data.ID MasterID {get; set;}

Remarks

A master is an instance of a template much like an item. When an item is created from a master, the master is copied into the new item which receives all the field values from the master. A master may contain subitems that are created whenever an item is created from a master.

An ID identifies an object within the system, but not uniquely. The underlying data of an ID is a Guid.

Example

The following example retrieves the master item. This can also be done by using the Master property.

{{
public MasterItem GetMaster(Item item) {
  MasterItem result = item.Database.Masters[item.MasterID];
  return result;
}
}}

See Also

Item Class | Sitecore.Data.Items Namespace