Tag helpers are also new to ASP.NET Core. A tag helper is a mechanism for adding server-side processing to a regular HTML/XML tag; you can think of them as similar to ASP.NET Web Forms' server-side controls, although there are several differences. Tag helpers are registered on Razor views and when any tag on the view matches a tag helper, it is fired. They are an alternative (and, arguably, simpler) to HTML helpers as they result in much cleaner markup without code blocks.
A tag helper's functionality is specified through the ITagHelper interface, in which the TagHelper abstract base class offers a base implementation. Its life cycle includes two methods:
- Init: Called when the tag helper is initialized, prior to any possible child
- ProcessAsync: The actual processing of a tag helper
A tag helper, on the view side, is nothing more than a regular tag and, as such, it can contain other tags,...