Class ContentRenderer
Webcontrol for BlockData. The control with create a child control with the selected render for the block type.
Inheritance
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class ContentRenderer : WebControl, IContentSource, INamingContainerConstructors
ContentRenderer()
Initializes a new instance of the ContentRenderer class.
Declaration
public ContentRenderer()Properties
AttributeAssembler
Declaration
public Injected<ContentFragmentAttributeAssembler> AttributeAssembler { get; set; }Property Value
| Type | Description | 
|---|---|
| Injected<ContentFragmentAttributeAssembler> | 
ContentAreaItem
Gets or sets the content area item.
Declaration
public ContentAreaItem ContentAreaItem { get; set; }Property Value
| Type | Description | 
|---|---|
| ContentAreaItem | 
CurrentContent
Gets or sets the current content.
Declaration
public IContent CurrentContent { get; set; }Property Value
| Type | Description | 
|---|---|
| IContent | 
CurrentControl
Gets or sets the block, which will be rendered.
Declaration
public Control CurrentControl { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Web.UI.Control | 
CurrentData
Gets or sets the block, which will be rendered.
Declaration
public IContentData CurrentData { get; set; }Property Value
| Type | Description | 
|---|---|
| IContentData | 
CustomTagName
Gets or sets the tag name. If not set a div-tag will be used.
Declaration
public string CustomTagName { get; set; }Property Value
| Type | Description | 
|---|---|
| System.String | 
IsCircularReference
Gets or sets a value indicating whether the CurrentControl is in a chain with circular references.
Declaration
public bool IsCircularReference { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
LocalizationService
Gets or sets the localization service.
Declaration
protected Injected<LocalizationService> LocalizationService { get; set; }Property Value
| Type | Description | 
|---|---|
| Injected<LocalizationService> | The localization service. | 
RenderSettings
Gets or sets the render settings that should be passed on to the content template.
Declaration
public IDictionary<string, object> RenderSettings { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IDictionary<System.String, System.Object> | 
Remarks
Note that the Tag property must be used to affect the template selection even if the RenderSettings dictionary contains a Tag or DisplayOptions (with Tag) entry.
RenderType
Sets the RenderType for the ContentRenderer.
Declaration
public RenderType RenderType { get; set; }Property Value
| Type | Description | 
|---|---|
| RenderType | A RenderType that is used to specify how the ContentRenderer should be rendered. | 
Tag
Gets or sets the current tag.
Declaration
public string Tag { get; set; }Property Value
| Type | Description | 
|---|---|
| System.String | 
TagName
Declaration
protected override string TagName { get; }Property Value
| Type | Description | 
|---|---|
| System.String | 
TemplateControlLoader
Gets or sets the template control loader, which will be used to find the correct controller for rendering the block.
Declaration
public Injected<TemplateControlLoader> TemplateControlLoader { get; set; }Property Value
| Type | Description | 
|---|---|
| Injected<TemplateControlLoader> | 
Methods
CreateChildControls()
The TemplateControlLoader will try to resolve the block control, which will be added to control collection.
Declaration
protected override void CreateChildControls()DataBind()
Binds a data source to the ContentRenderer and all its child controls.
Declaration
public override void DataBind()EnsureChildControlsCreated()
Ensures that the child controls have been created, or create them.
Declaration
public void EnsureChildControlsCreated()Get<T>(ContentReference)
Retrieves a IContent object with information about a content, based on the ContentReference parameter.
Declaration
public T Get<T>(ContentReference contentLink)
    where T : IContentDataParameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | Reference to the content being retrieved | 
Returns
| Type | Description | 
|---|---|
| T | IContent object requested | 
Type Parameters
| Name | Description | 
|---|---|
| T | 
GetChildren<T>(ContentReference)
Retrieve a IContent listing
Declaration
public IEnumerable<T> GetChildren<T>(ContentReference contentLink)
    where T : IContentDataParameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | Reference to parent content | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<T> | Returns a collection of IContent directly below the content referenced by the ContentReference parameter. | 
Type Parameters
| Name | Description | 
|---|---|
| T | 
RenderBeginTag(HtmlTextWriter)
Renders the HTML opening tag of the control to the specified writer if there is a current control available or if in edit mode.
Declaration
public override void RenderBeginTag(HtmlTextWriter writer)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.UI.HtmlTextWriter | writer | A System.Web.UI.HtmlTextWriter that represents the output stream to render HTML content on the client. | 
RenderEndTag(HtmlTextWriter)
Renders the HTML closing tag of the control into the specified writer if there is a current control available or if in edit mode.
Declaration
public override void RenderEndTag(HtmlTextWriter writer)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.UI.HtmlTextWriter | writer | A System.Web.UI.HtmlTextWriter that represents the output stream to render HTML content on the client. | 
