Using the textbox HTML Helper (HTML.TextBox), what you have is a late-bound object which is populated basically first with the name or id of the textbox on the page. The second parameter (although there are other overloads) is the class object. For instance:
It works the same in both ASP.Net and Razor syntax.
However, there are also early bound helpers you can use, like (in this case) the TextBoxFor object. With this, there is no need for the first parameter, since, to quote a Scott Guthrie blog post:
“…lambda expressions are flexible enough that we can retrieve both the name of the property/field on our model object in addition to its value”
So, to use this, we could do it this way:
Html.TextBoxFor(model => model.CustomerName)
This also follow over to the other HTML helper objects (checkbox, listbox, dropdownList, etc.)
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF