Difference between Html.EditorFor and Html.TextboxFor in ASP.NET MVC?

If you are working on Web Application development using ASP.NET MVC, you would come across the Html.EditorFor and Html.TextboxFor in the Razor View.

What is the Difference between Html.EditorFor and Html.TextboxFor in ASP.NET MVC?

The Html.TextboxFor creates a textbox with the input type of text. It will always render the input textbox.

The EditorFor is a kind of smart helper method. This will render the control based on the type in the model. For example, assume that you have a Boolean field in the model bind to the EditorFor. This will render checkbox.

Leave Your Comment

Liked this content?. Please spread the word :)