Reputation: 2749
What is the difference between @Html.DropDownList
and @Html.DropDownListFor
in MVC3?
All I know is @Html.DropDownList
is used to render a dropdownList
with a List
and @Html.DropDownListFor
with a Model
.
I am not sure if this is right or not.
Upvotes: 0
Views: 2088
Reputation: 5832
DropDownList
is bound to arbitrary value you pass in and generates input
named after parameter you pass in.
DropDownListFor
is bound to property in your model (defined by expression passed in) and generates input
named after that property according to defined model binder condition.
Upvotes: 3