I am using the following code to let user select multiple locations on the form.
@Html.DropDownListFor(m => m.location_code, Model.location_type, new { @class = "form-control", @multiple = "multiple" }).
location_code is an List<int>
and location_type is List<SelectListItem>
populated with data.
The code does return me the selected values in the controller, but when the user clicks on edit button the object passed does not show the selected values but instead shows the normal initialized dropdown with nothing selected.
What i actually want is that once the user submits the form (including the multiple selected values) it goes to a page where user confirms if the details are correct.If not he presses edit button and the object is again passed to controller.In this phase it should show the multiple values selected.Other fields behave properly .
Any insight on this ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…