@Html.DropDownListFor(m => m.branch, CommonMethod.getBranch(\"\",Model.branch), \"--Select--\", new { @multiple = \"multiple\" })
@Html.DropDownListFor(m => m
Though quite old thread but posting this answer after following other answers here, which unfortunately didn't work for me. So, for those who might have stumbled here recently or in near future, Below is what has worked for me.
This is what helped me
The catch for me was MultiSelectList class and I was using SelectList.
Don't know situation in 2012 or 2015. but, now both these helper methods @Html.DropDownListFor and @Html.ListBoxFor helper methods accept IEnumerable so you can not pass any random IEnumerable object and expect these helper methods to do the job.
These helper methods now also accept the object of SelectList and MultiSelectList classes in which you can pass the selected values directly while creating there objects.
For example see below code how i created my multi select drop down list.
@Html.DropDownListFor(model => @Model.arrSelectUsers, new MultiSelectList(Model.ListofUsersDTO, "Value", "Text", @Model.arrSelectUsers),
new
{
id = "_ddlUserList",
@class = "form-control multiselect-dropdown",
multiple = "true",
data_placeholder = "Select Users"
})