The goal of TagHelpers is to reduce the writing of the views using HTML tags and/or attributes interpreted by Razor. They replace HTMLHelpers with the closest syntax of HTML, allowing integrators to work with MVC views more easily:
- First, let's add an Insert action method for GET and POST in HomeController.cs, and let's add a break point on the Insert method of POST:
- Next, let's add the Insert view with TagHelper code for an input to test TagHelpers:
- We can see the asp-for TagHelper added to the input text HTML element. ...