Tag Helpers

Validation Tag Helpers in ASP.NET Core

The ASP.NET provides validation related tag helpers which display the validation messages to the user. We learned how server-side model validation works in the previous tutorial. The Model binder binds and validates the data received over the HTTP Request. It then creates the ModelState object, which contains the validation messages generated by the Model Binder. The Validation Tag helpers generate the HTML element to display these messages in the view.

Validation Tag Helpers in ASP.NET Core Read More »

Input Tag Helper ASP.NET Core

The Input Tag Helper generates the appropriate <input> HTML element for the model property. The model property is bound using the asp-for attribute.  The input tag helper generates the appropriate HTML type, name & id attribute based on the Property data type & data annotations applied to the ViewModel. The ViewModel must be strongly typed to the View. It also emits the Validation related attributes, which helps in unobtrusive client-side validation. The asp-format attributes help in generating the properly formatted input elements.

Input Tag Helper ASP.NET Core Read More »

Scroll to Top