What is the best ways to bind @Html.DropDownListFor in ASP.NET MVC5?

The strongly typed view model approach which does not use dynamic stuff like ViewBag You can add a new property to your view model for the SELECT options of type IEnumrable<SelectListItem>. view model is a simple POCO class used to transfer data between view to action method and vice versa. They are specific to the … Read more

There is no ViewData item of type ‘IEnumerable’ that has the key ‘xxx’

Ok, so the answer was derived from some other posts about this problem and it is: If your ViewData contains a SelectList with the same name as your DropDownList i.e. “submarket_0”, the Html helper will automatically populate your DropDownList with that data if you don’t specify the 2nd parameter which in this case is the … Read more