ASP.NET Core

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 »

Strongly Typed View in ASP.NET Core MVC

In the previous tutorial, we saw how to build a simple HTML form. We made use of the ViewModel, but did not pass the instance of it to the view. The ViewModel can be passed from the controller to the view either using  Viewbag or Viewdata. The ASP.NET Core provides the ability to pass strongly typed models or objects to a view. This approach helps us with the intellisense and better compile-time checking of our code. The scaffolding mechanism in Visual Studio can be used to create the View. Let us learn all these in the article.

Strongly Typed View in ASP.NET Core MVC Read More »

Scroll to Top