Interface IDynamicContent
Developers wishing to display dynamic content in an EPiServer XHTML string should implement this interface.
Namespace: EPiServer.DynamicContent
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[Obsolete("Implement IDynamicContentControl instead to make a custom Web Forms implementation, or IDynamicContentView to support both web forms and MVC")]
public interface IDynamicContent : IDynamicContentBase
Properties
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
bool RendersWithControl { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
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
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
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 |