Difference between @html.TextBox and @html.TextBoxFor.
My answer on Quora:
In abstract terms, the difference between the html helpers @html.TextBox() and @html.TextBoxFor() are the former is weakly typed and is independent of model and the latter is strongly typed and it should be bound to one of the model property in strongly typed view.
Consider the below piece of code,
This will be rendered as shown in the below image.
When you use, TextBoxFor, while the HTML is generated, it will automatically map the value from the model property to it, in the above case “UserName” . So when you post the values of the current page, if your controller is having your model as the parameter, the value can be retrived directly by accessing the property.
When you look at the above screenshot, the model will not hold the weekly typed “simpleTextBox”.
Hope you find it useful.