I have multiple dropdown list:
@Html.DropDownListFor(x => x.HaveColoSpace.SelectedOptions, new SelectList(Model.HaveColoSpace.Options, "Value", "Text"), new { multiple = "multiple" })
where Model.HaveColoSpace.SelectedOptions is List with 2 items (“3” and “5”), Model.HaveColoSpace.Options has List
Why items with value “3” and “5” are not pre-selected after loading a page?
Use the
Html.ListBoxForhelper instead ofHtml.DropDownListForif you want to generate a multiselect dropdown list: