EnvironmentTagHelper Class

Summary

@!:ITagHelper- implementation targeting <environment> elements that conditionally renders content based on the current value of @!:IHostingEnvironment.EnvironmentName-.

Syntax

public class EnvironmentTagHelper : TagHelper

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.TagHelpers.EnvironmentTagHelper

Constructors

EnvironmentTagHelper(IHostingEnvironment)

Creates a new [Microsoft.AspNet.Mvc.TagHelpers.EnvironmentTagHelper](Microsoft.AspNet.Mvc.TagHelpers.EnvironmentTagHelper.yml).

Arguments:
  • hostingEnvironment (IHostingEnvironment) – The @!:IHostingEnvironment-.
public EnvironmentTagHelper(IHostingEnvironment hostingEnvironment)

Properties

HostingEnvironment()
Return type:IHostingEnvironment
protected IHostingEnvironment HostingEnvironment { get; }
Names()

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

Return type:System.String
public string Names { get; set; }

Methods

Process(TagHelperContext, TagHelperOutput)
Arguments:
  • context (TagHelperContext) –
  • output (TagHelperOutput) –
public override void Process(TagHelperContext context, TagHelperOutput output)