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.Cms.AspNet.dll
Version: 11.20.7Syntax
public class ContentRenderer : WebControl, IContentSource, INamingContainer
Constructors
ContentRenderer()
Initializes a new instance of the Content
Declaration
public ContentRenderer()
Properties
AttributeAssembler
The attribute assembler
Declaration
public Injected<IContentAreaItemAttributeAssembler> AttributeAssembler { get; set; }
Property Value
Type | Description |
---|---|
Injected<IContent |
ContentAreaItem
Gets or sets the content area item.
Declaration
public ContentAreaItem ContentAreaItem { get; set; }
Property Value
Type | Description |
---|---|
Content |
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. |
CurrentData
Gets or sets the block, which will be rendered.
Declaration
public IContentData CurrentData { get; set; }
Property Value
Type | Description |
---|---|
IContent |
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. |
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. |
LocalizationService
Gets or sets the localization service.
Declaration
protected Injected<LocalizationService> LocalizationService { get; set; }
Property Value
Type | Description |
---|---|
Injected<Localization |
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. |
Remarks
Note that the Tag property must be used to affect the template selection
even if the Render
RenderType
Sets the RenderType for the Content
Declaration
public RenderType RenderType { get; set; }
Property Value
Type | Description |
---|---|
Render |
A RenderType that is used to specify how the Content |
Tag
Gets or sets the current tag.
Declaration
public string Tag { get; set; }
Property Value
Type | Description |
---|---|
System. |
TagName
Declaration
protected override string TagName { get; }
Property Value
Type | Description |
---|---|
System. |
TemplateControlLoader
Gets or sets the template control loader, which will be used to find the correct controller for rendering the block.
Declaration
[Obsolete("Use TemplateControlLoaderService instead")]
public Injected<ITemplateControlLoader> TemplateControlLoader { get; set; }
Property Value
Type | Description |
---|---|
Injected<ITemplate |
TemplateControlLoaderService
Gets or sets the template control loader, which will be used to find the correct controller for rendering the block.
Declaration
public Injected<ITemplateControlLoader> TemplateControlLoaderService { get; set; }
Property Value
Type | Description |
---|---|
Injected<ITemplate |
Methods
CreateChildControls()
The Template
Declaration
protected override void CreateChildControls()
DataBind()
Binds a data source to the Content
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
Content
Declaration
public T Get<T>(ContentReference contentLink)
where T : IContentData
Parameters
Type | Name | Description |
---|---|---|
Content |
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 : IContentData
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | Reference to parent content |
Returns
Type | Description |
---|---|
System. |
Returns a collection of IContent directly below the content referenced by
the Content |
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. |
writer | A System. |
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. |
writer | A System. |