This content is archived. See latest version here

Last updated: Mar 25 2013

Table of Contents


EPiServer CMS uses a set of interfaces to determine for example how to render Dynamic Content. You are required to use these interfaces unless you use the plug-in functionality that automatically wraps a user control described in Creating a Plug-in.

About the IDynamicContentBase Interface

The IDynamicContentBase interface is the fundamental building block of a dynamic content class. This interface is implicitly used when you make use of the DynamicContentPlugIn attribute but its use is automatic and hidden from you. The interface's methods and properties are explained below.

string State { get; set; }

Get and set the state string for an instance. The class should use this value to serialize and deserialize its internal state. This can be null or an empty string.

PropertyDataCollection Properties { get; }

Get a collection of EPiServer properties that should be presented in the editorial interface. The properties within the collection should be members of the plug-in class so that the values entered from the editorial interface can be consumed.

About the IDynamicContentView Interface

The IDynamicContentView extends IDynamicContentBase with methods to support rendering in both web forms and MVC. This is the recommended interface to use when implementing a custom dynamic content.

void Render(TextWriter writer)

The Render method should write HTML to display on the page. This is what the visitor actually sees when they visit the page the object is being rendered on.

About the IDynamicContentControl Interface

The IDynamicContentControl extends IDynamicContentBase with methods to support rendering in web forms using controls.

System.Web.UI.Control GetControl(TemplateControl hostPage)

The GetControl method should return a reference to a control. The control returned can be anything that derives from control including web controls, user controls and custom controls. You can use hostPage.LoadControl to load user controls.

About the System.Web.Mvc.IView Interface

As mentioned earlier the IDynamicContentView interface support both MVC and Web Forms but in some scenarios you need access to the ViewContext class. If a dynamic content class implements this interface it takes presidence over the other interfaces when running inside a MVC view.

Do you have feedback on this documentation? Send an email to For development-related questions and discussions, refer to our Forums on