Class ContentRenderingScope
A helper object that can be used when rendering content in for example a Content
Implements
Namespace: EPiServer.Web.Templating
Assembly: EPiServer.Cms.AspNetCore.Templating.dll
Version: 12.0.3Syntax
public class ContentRenderingScope : Object, IDisposable
Remarks
This class implements System.
Constructors
ContentRenderingScope(HttpContext, IContentData, TemplateModel, IEnumerable<String>)
Initializes a new instance of the Content
Declaration
public ContentRenderingScope(HttpContext context, IContentData contentData, TemplateModel templateModel = null, IEnumerable<string> templateTags = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
context | |
IContent |
contentData | |
Template |
templateModel | |
System. |
templateTags |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Triggers the end element when disposing
is true
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System. |
disposing |
|
PopCurrentContent(HttpContext, IContentData)
Pops the current content rendered from context. This is needed when rendering a content area since then the current rendered might differ from the routed content. So this method should be used in combination with PushCurrentContent(HttpContext, IContentData, TemplateModel, IEnumerable<String>).
Declaration
public static void PopCurrentContent(HttpContext context, IContentData contentData)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
context | |
IContent |
contentData |
Remarks
Instead of calling PushCurrentContent(HttpContext, IContentData, TemplateModel, IEnumerable<String>) and Pop
PushCurrentContent(HttpContext, IContentData, TemplateModel, IEnumerable<String>)
Pushes the current content rendered to context. This is needed when rendering a content area since then the current rendered might differ from the routed content.
Declaration
public static void PushCurrentContent(HttpContext context, IContentData contentData, TemplateModel templateModel = null, IEnumerable<string> templateTags = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
context | |
IContent |
contentData | |
Template |
templateModel | |
System. |
templateTags |
Remarks
Instead of calling PushCurrentContent(HttpContext, IContentData, TemplateModel, IEnumerable<String>) and Pop