Class PlaceholderTagHelper

Version: 21.x

Tag helper for the Sitecore placeholder element.

Inheritance

System.Object

PlaceholderTagHelper

Namespace: Sitecore.AspNet.RenderingEngine.TagHelpers

Assembly: Sitecore.AspNet.RenderingEngine.dll

Syntax
public class PlaceholderTagHelper : TagHelper

Constructors

PlaceholderTagHelper(IComponentRendererFactory, IEditableChromeRenderer)

Initializes a new instance of the PlaceholderTagHelper class.

Declaration
public PlaceholderTagHelper(IComponentRendererFactory componentFactory, IEditableChromeRenderer chromeRenderer)
Parameters
TypeNameDescription
IComponentRendererFactorycomponentFactoryAn instance of IComponentRendererFactory.
IEditableChromeRendererchromeRendererAn instance of IEditableChromeRenderer.

Properties

Name

Gets or sets the name of the placeholder to be rendered.

Declaration
public string Name { get; set; }
Property Value
TypeDescription
System.String

ViewContext

Gets or sets the current view context for the tag helper.

Declaration
public ViewContext ViewContext { get; set; }
Property Value
TypeDescription
Microsoft.AspNetCore.Mvc.Rendering.ViewContext

Methods

ProcessAsync(TagHelperContext, TagHelperOutput)

Declaration
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContextcontext
Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutputoutput
Returns
TypeDescription
System.Threading.Tasks.Task
If you have suggestions for improving this article, let us know!