EnvironmentTagHelper Class

Microsoft.AspNetCore.Razor.TagHelpers.ITagHelper implementation targeting <environment> elements that conditionally renders content based on the current value of Microsoft.AspNetCore.Hosting.IHostingEnvironment.EnvironmentName.

Namespace
Microsoft.AspNetCore.Mvc.TagHelpers
Assemblies
  • Microsoft.AspNetCore.Mvc.TagHelpers

Syntax

public class EnvironmentTagHelper : TagHelper, ITagHelper
class Microsoft.AspNetCore.Mvc.TagHelpers.EnvironmentTagHelper

Constructors

EnvironmentTagHelper(Microsoft.AspNetCore.Hosting.IHostingEnvironment)

Creates a new Microsoft.AspNetCore.Mvc.TagHelpers.EnvironmentTagHelper.

Arguments:hostingEnvironment (Microsoft.AspNetCore.Hosting.IHostingEnvironment) – The Microsoft.AspNetCore.Hosting.IHostingEnvironment.
public EnvironmentTagHelper(IHostingEnvironment hostingEnvironment)

Properties

Microsoft.AspNetCore.Mvc.TagHelpers.EnvironmentTagHelper.HostingEnvironment
Return type:Microsoft.AspNetCore.Hosting.IHostingEnvironment
protected IHostingEnvironment HostingEnvironment { get; }
Microsoft.AspNetCore.Mvc.TagHelpers.EnvironmentTagHelper.Names

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

Return type:System.String
public string Names { get; set; }
Microsoft.AspNetCore.Mvc.TagHelpers.EnvironmentTagHelper.Order
Return type:System.Int32
public override int Order { get; }

Methods

Process(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput)
public override void Process(TagHelperContext context, TagHelperOutput output)