Overview
Tag Helpers extend standard HTML elements. They provide extra server-side attributes for an HTML element.
Partial Tag Helper
Asynchronously renders a partial view.
Note that the name attribute accepts the partial view’s name without its file extension:
<partial name="_ValidationScriptsPartial" />
This is equivalent to Razor HTML Helper syntax:
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
Label Tag Helper
Extends the HTML <label>
element:
The asp-for attribute accepts a PageModel property. The value of the PageModel’s Name property will be rendered as the content for the
Input Tag Helper Extends the HTML element:
It renders this HTML:
This helper: • Evaluates NewPizza.Name property • Adds an id and name HTML attribute based on that property • Sets the input type. For example, if the property’s type was bool, it would set the input type as checkbox. • Provides client-side validation via jQuery based on the model’s data annotation attributes from the PageModel. • If client-side validation succeeded, it prompts the Razor engine to perform further server-side validation.
Validation Summary Tag Helper Displays a validation message for a single property: <divasp-validation-summary=“All”>
It renders this HTML: