November Happy Hour will be moved to Thursday December 5th.

Class BlockData

Contains information about a specific block.

Inheritance
System.Object
BlockData
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[AvailableContentTypes]
[AdministrationSettings(GroupName = "blocktypes", Visible = true, Order = 20)]
public class BlockData : ContentData, IContentData, IInitializableContent, IModifiedTrackable, IReadOnly<BlockData>, IReadOnly
Examples
The following example shows how you can create a custom block data:
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAnnotations;
using EPiServer.Framework.DataAnnotations;
using EPiServer.SpecializedProperties;
using EPiServer.Web;

[ContentType(DisplayName = "A page list", Description = "A block of properties needed to display a page list")]
public class PageList : BlockData
{
public virtual PageReference Root { get; set; }
public virtual int Count { get; set; }
public virtual string Heading { get; set; }
}

[ContentType]
public class MyPage : PageData
{
public virtual XhtmlString MainBody { get; set; }
public virtual PageList MainList { get; set; }
}

[TemplateDescriptor(Name = "My template", Description = "My first template", Path = "~/templates/MyTemplate.aspx", Default = true)]
public partial class MyTemplate : TemplatePage<MyPage>
{ }

[TemplateDescriptor(Name = "My block control", Description = "My first block control", Path = "~/templates/MyBlockControl.ascx", Default = true)]
public partial class MyBlockControl : BlockControlBase<PageList>
{ }

Constructors

BlockData()

Declaration
public BlockData()

Methods

CreateWritableClone()

Creates a writable clone of this object.

Declaration
public virtual BlockData CreateWritableClone()
Returns
Type Description
BlockData

A clone of this object.

Implements

Extension Methods