SaaS CMS has officially launched! Learn more now.

Class DynamicContentAdapter<T>

A dynamic content implementation that wraps a regular web control / user control.

Inheritance
System.Object
DynamicContentAdapter<T>
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 class DynamicContentAdapter<T> : DynamicContentBase, IDynamicContentDisplayType, IDynamicContentControl, IDynamicContentBase, IDynamicContentControlAdapter where T : Control, new()
Type Parameters
Name Description
T

The actual control type that will be wrapped.

Constructors

DynamicContentAdapter()

Initializes a new instance of the DynamicContentAdapter<T> class.

Declaration
public DynamicContentAdapter()

Properties

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 override string State { get; set; }
Property Value
Type Description
System.String

A string representing the serialized state.

Overrides

Methods

GetControl(TemplateControl)

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
public virtual Control GetControl(TemplateControl hostPage)
Parameters
Type Name Description
System.Web.UI.TemplateControl 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

InitializeControlState(Control)

Initalizes the contained web control with all values from the State of this instance.

Declaration
protected virtual void InitializeControlState(Control control)
Parameters
Type Name Description
System.Web.UI.Control control

Explicit Interface Implementations

IDynamicContentControlAdapter.ControlType

Gets the type of the control that is adapted.

Declaration
Type IDynamicContentControlAdapter.ControlType { get; }
Returns
Type Description
System.Type

The type of the control.

IDynamicContentControlAdapter.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
PropertyDataCollection IDynamicContentControlAdapter.Properties { get; }
Returns
Type Description
PropertyDataCollection

IDynamicContentControlAdapter.TransferDataFromControlToProperties(Control)

Called from framework when the adapter should transfer values from the control instance to the Properties collection.

Declaration
void IDynamicContentControlAdapter.TransferDataFromControlToProperties(Control control)
Parameters
Type Name Description
System.Web.UI.Control control

The control.

Remarks

When saving dynamic content settings from edit mode, first a call will be made to PrepareForSave(). After the call a check will be performed against Properties to see if it is modified. If not this method is called.

Implements

Extension Methods