FeatureTagHelper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a <feature> tag that can be used to conditionally render content based on a feature's state.
public class FeatureTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
type FeatureTagHelper = class
inherit TagHelper
Public Class FeatureTagHelper
Inherits TagHelper
- Inheritance
-
FeatureTagHelper
Constructors
| Name | Description |
|---|---|
| FeatureTagHelper(IFeatureManagerSnapshot, IVariantFeatureManagerSnapshot) |
Creates a feature tag helper. |
Properties
| Name | Description |
|---|---|
| Name |
A feature name, or comma separated list of feature names, for which the content should be rendered. By default, all specified features must be enabled to render the content, but this requirement can be controlled by the Requirement property. |
| Negate |
Negates the evaluation for whether or not a feature tag should display content. This is used to display alternate content when a feature or set of features are disabled. |
| Requirement |
Controls whether 'All' or 'Any' feature in a list of features should be enabled to render the content within the feature tag. |
| Variant |
A variant name, or comma separated list of variant names. If any of specified variants is assigned, the content should be rendered. If variant is specified, Name must contain only one feature name and Requirement will have no effect. |
Methods
| Name | Description |
|---|---|
| ProcessAsync(TagHelperContext, TagHelperOutput) |
Processes the tag helper context to evaluate if the feature's content should be rendered. |