I want to preselect (from my controller) multiple options in a list. I've tried almost everything, but I am not able to get the items selected.
What's wrong with this?
@Html.DropDownListFor(x=>x.UserIds, Model.Users, new { @class = "form-control input-sm chosen", multiple = "multiple"})
I've also tried @Html.DropdownList() - without success.
Everything seems to be fine in my model. The selectlist has a selected item and the item's selected property is true, but I only get unselected options.

Use @Html.ListBox or @Html.ListBoxFor instead of @Html.DropDownList
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With