Class TemplateControlLoader

Inheritance
System.Object
TemplateControlLoader
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.Web
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[ServiceConfiguration(typeof(TemplateControlLoader))]
public class TemplateControlLoader

Constructors

TemplateControlLoader(TemplateResolver, DisplayOptions)

Initializes a new instance of the TemplateControlLoader class.

Declaration
public TemplateControlLoader(TemplateResolver templateResolver, DisplayOptions displayOptions)
Parameters
Type Name Description
TemplateResolver templateResolver

The template resolver that should be used to resolve the control to load.

DisplayOptions displayOptions

The display options service.

Methods

LoadControl(HttpContextBase, IContentData, TemplateControl)

Loads the template control that is associated with the provided content item.

Declaration
public virtual Control LoadControl(HttpContextBase httpContext, IContentData contentData, TemplateControl templateControl)
Parameters
Type Name Description
System.Web.HttpContextBase httpContext

The HTTP context.

IContentData contentData

The content data that the template should be associated with.

System.Web.UI.TemplateControl templateControl

The template control used to load any user controls with.

Returns
Type Description
System.Web.UI.Control

A new template control instance or null if no template existed.

LoadControl(HttpContextBase, IContentData, TemplateControl, String, IDictionary<String, Object>)

Loads the template control that is associated with the provided content item.

Declaration
public virtual Control LoadControl(HttpContextBase httpContext, IContentData contentData, TemplateControl templateControl, string tag, IDictionary<string, object> renderSettings)
Parameters
Type Name Description
System.Web.HttpContextBase httpContext

The HTTP context.

IContentData contentData

The content data that the template should be associated with.

System.Web.UI.TemplateControl templateControl

The template control used to load any user controls with.

System.String tag

The tag to match for on templates.

System.Collections.Generic.IDictionary<System.String, System.Object> renderSettings

The render settings.

Returns
Type Description
System.Web.UI.Control

A new template control instance or null if no template existed.

LoadControl(HttpContextBase, Type, Object, TemplateControl, String, IDictionary<String, Object>, Action<Control, Object>)

Loads the template control that is associated with the provided content item.

Declaration
public virtual Control LoadControl(HttpContextBase httpContext, Type renderType, object renderData, TemplateControl templateControl, string tag, IDictionary<string, object> renderSettings, Action<Control, object> bindDataAction)
Parameters
Type Name Description
System.Web.HttpContextBase httpContext

The HTTP context.

System.Type renderType

Type of the render.

System.Object renderData

The render data.

System.Web.UI.TemplateControl templateControl

The template control used to load any user controls with.

System.String tag

The tag.

System.Collections.Generic.IDictionary<System.String, System.Object> renderSettings

The render settings.

System.Action<System.Web.UI.Control, System.Object> bindDataAction

Delegate called after control creation where data can be bound to control

Returns
Type Description
System.Web.UI.Control

A new template control instance or null if no template existed.

Extension Methods