EnvironmentTagHelper EnvironmentTagHelper EnvironmentTagHelper Class

Definition

ITagHelper implementation targeting <environment> elements that conditionally renders content based on the current value of EnvironmentName. If the environment is not listed in the specified Names or Include, or if it is in Exclude, the content will not be rendered.

public class EnvironmentTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
type EnvironmentTagHelper = class
    inherit TagHelper
Public Class EnvironmentTagHelper
Inherits TagHelper
Inheritance
EnvironmentTagHelperEnvironmentTagHelperEnvironmentTagHelper

Constructors

EnvironmentTagHelper(IHostingEnvironment) EnvironmentTagHelper(IHostingEnvironment) EnvironmentTagHelper(IHostingEnvironment)

Creates a new EnvironmentTagHelper.

Properties

Exclude Exclude Exclude

A comma separated list of environment names in which the content will not be rendered.

HostingEnvironment HostingEnvironment HostingEnvironment
Include Include Include

A comma separated list of environment names in which the content should be rendered. If the current environment is also in the Exclude list, the content will not be rendered.

Names Names Names

A comma separated list of environment names in which the content should be rendered. If the current environment is also in the Exclude list, the content will not be rendered.

Order Order Order

Methods

Init(TagHelperContext) Init(TagHelperContext) Init(TagHelperContext)

Initializes the ITagHelper with the given context. Additions to Items should be done within this method to ensure they're added prior to executing the children.

(Inherited from TagHelper)
Process(TagHelperContext, TagHelperOutput) Process(TagHelperContext, TagHelperOutput) Process(TagHelperContext, TagHelperOutput)
ProcessAsync(TagHelperContext, TagHelperOutput) ProcessAsync(TagHelperContext, TagHelperOutput) ProcessAsync(TagHelperContext, TagHelperOutput)

Asynchronously executes the TagHelper with the given context and output.

(Inherited from TagHelper)

Applies to