1.2 KiB
The <form method="post">
element is a Form Tag Helper. The Form Tag Helper automatically includes an antiforgery token.
The scaffolding engine creates Razor markup for each field in the model (except the ID) similar to the following:
[!code-cshtmlMain]
The Validation Tag Helpers (<div asp-validation-summary
and <span asp-validation-for
) display validation errors. Validation is covered in more detail later in this series.
The Label Tag Helper (<label asp-for="Movie.Title" class="control-label"></label>
) generates the label caption and for
attribute for the Title
property.
The Input Tag Helper (<input asp-for="Movie.Title" class="form-control" />
) uses the DataAnnotations attributes and produces HTML attributes needed for jQuery Validation on the client-side.