SaaS CMS has officially launched! Learn more now.

Class DynamicContentBase

Base implementation of the IDynamicContent interface.

Inheritance
System.Object
DynamicContentBase
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DynamicContent
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
public abstract class DynamicContentBase : IDynamicContentBase, IDynamicContentDisplayType
Remarks

Basically takes care of the state handling for your dynamic content control.

Constructors

DynamicContentBase()

Initializes a new instance of the DynamicContentBase class.

Declaration
protected DynamicContentBase()

Properties

Properties

This property is used by the EPiServer default Dynamic Content editor to display the properties that require input for your Dynamic Content object. If you supply your own editor by deriving a class from DynamicContentEditControl then this property can return null

Declaration
public PropertyDataCollection Properties { get; protected set; }
Property Value
Type Description
PropertyDataCollection

RenderAsBlockElement

Gets a value indicating whether this should be rendered as a block element (div) not (span).

Declaration
public virtual bool RenderAsBlockElement { get; }
Property Value
Type Description
System.Boolean

true if this should be rendered as a block element; otherwise, false.

Remarks

Default for DynamicContentBase is to render as a block element.

RendersWithControl

Return true if the class uses a control to render, otherwise return false to render directly from this clas via the Render method

Declaration
[Obsolete("Implement IDynamicContentControl instead to make a custom Web Forms implementation, or IDynamicContentView to support both web forms and MVC", true)]
public virtual bool RendersWithControl { get; }
Property Value
Type Description
System.Boolean

State

Get and sets the state string for your instance. The class should use this value to serialize and deserialize its internal state. This can be null or an empty string if your class does not have any properties that affect it's output.

Declaration
public virtual string State { get; set; }
Property Value
Type Description
System.String

A string representing the serialized state.

Methods

GetControl(PageBase)

Return a control to render the dynamic content on the page. This method will only be called by EPiServer if the

RendersWithControl
property returns true

Declaration
[Obsolete("Implement IDynamicContentControl instead to make a custom Web Forms implementation, or IDynamicContentView to support both web forms and MVC", true)]
public virtual Control GetControl(PageBase hostPage)
Parameters
Type Name Description
PageBase hostPage

A reference to the EPiServer page hosting the dynamic content.

Returns
Type Description
System.Web.UI.Control

A control that renders the dynamic content

Render(PageBase)

Return the dynamic content as a string. This method will only be called by EPiServer if the

RendersWithControl
property returns false

Declaration
[Obsolete("Implement IDynamicContentControl instead to make a custom Web Forms implementation, or IDynamicContentView to support both web forms and MVC", true)]
public virtual string Render(PageBase hostPage)
Parameters
Type Name Description
PageBase hostPage

A reference to the EPiServer page hosting the dynamic content. This can be null as Render can be called when there is no page in context

Returns
Type Description
System.String

A string containing your content

Implements

Extension Methods