Tag Helpers
Tag Helpers are ASP.NET Core components that process HTML-like elements during Razor view or page rendering.
Pro ASP.NET Core 7, Tenth Edition
A tag helper is an ASP.NET Core component implemented as a C# class that transforms HTML-like elements during Razor view or page processing.
- How it is used
- Transforms Razor view or page elements into HTML that reflects application routing, models, styling, or validation state.
- How deep it goes
- Works through subclassing, attribute binding, targeting, registration, output manipulation, context data, and model expressions; does not detail ModelExpression introspection.
- Examples
- Uses styled table rows, product-page links, shorthand table headers, model-property rows, conditional warnings, and RSVP validation.
- What you can do after
- Build it from scratch as a registered custom TagHelper, or apply built-in helpers to links, forms, assets, and validation displays.
Read how Pro ASP.NET Core 7, Tenth Edition explains Tag Helpers →
ASP.NET Core in Action, 3e
Tag Helpers are ASP.NET Core components that add server-side processing behavior to HTML-like elements in Razor files.
- How it is used
- Generates server-rendered HTML, especially forms, from Razor templates and model properties while keeping markup editor-friendly.
- How deep it goes
- Explains built-in form helpers and works through custom targeting, output processing, conditional rendering, and child-content handling.
- Examples
- Uses currency-converter and checkout forms, a server-information element, and a conditional-rendering attribute.
- What you can do after
- Build custom Tag Helpers and apply built-in helpers to generate model-based forms.
What to know first
- asp-for attributeThe asp-for attribute is an ASP.NET Core Razor attribute that associates an HTML element with a model property for Tag Helper processing.
- attributeAn attribute is a named property or piece of information associated with an entity, object, or structured data item.
- handlerA handler is a software routine or component invoked to process an event, request, message, or other input.
Related concepts
- classkind of · A class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.
- @addTagHelper directiveconfigured by · The @addTagHelper directive makes specified Tag Helpers available for processing in Razor views or pages.
- anchor tag helperincludes · The Anchor Tag Helper is an ASP.NET Core component that generates anchor URLs from routing and Razor Page attributes.
- EnvironmentTagHelperincludes · EnvironmentTagHelper is an ASP.NET Core Tag Helper that conditionally renders element content according to the current hosting environment.
- form tag helperincludes · The Form Tag Helper is an ASP.NET Core Tag Helper that processes Razor form elements and generates form-related HTML attributes and antiforgery content.
- label tag helperincludes · The Label Tag Helper is an ASP.NET Core Tag Helper that generates labeled content and associates it with a model-bound form field.
Questions about Tag Helpers
What is Tag Helpers?
Tag Helpers are ASP.NET Core components that process HTML-like elements during Razor view or page rendering.
Which Manning books explain Tag Helpers?
Pro ASP.NET Core 7, Tenth Edition and ASP.NET Core in Action, 3e.
What should I know before learning Tag Helpers?
Manning books that teach Tag Helpers usually introduce asp-for attribute, attribute, C# and handler first.
What kinds of Tag Helpers are there?
Kinds of Tag Helpers include anchor tag helper, EnvironmentTagHelper, form tag helper and label tag helper.
What is Tag Helpers a kind of?
Tag Helpers is a kind of class. A class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

