You’ve probably wondered, along the way using MVC, what the advantages or differences are between the Editorfor HTML Helper and the TextBoxFor HTML Helper.
First off, think of the EditorFor as tied to the model. Whatever datatype you have for a particular property in the model is reflected in the view itself. For instance, a Boolean property will show up as a checkbox, whereas a string property will show up as a textbox. Think of a TextBoxFor as a ‘hard-coded’ html input tag with a type of ‘text’.
One side note is that with a TextBoxFor, you will need to add css to the tag itself if changes are needed, because DataAnnotations (in the model) will not work like the EdtorFor.
This is just a ‘glimpse’ into the differences between the two, so just think of this as a Part 1.
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF