I making an attempt to make use of the MultiSlectList in APS.NET MVC with chosen gadgets.
That is the backend code:
var listPoles = new Checklist<lengthy>(); foreach (var pole in employeePole.PolesList) listPoles.Add(pole.Id); ViewBag.poles = new MultiSelectList(GetPoles().ToList(), "Id", "Title", listPoles);
GetPoles() returns a IReadOnlyList.
HTML code (view):
<choose a number of="a number of" title="selecione..." class="form-control selectpicker" id="poles" asp-for="@Mannequin.Poles" asp-items="@ViewBag.poles"></choose>
In edit view (front-end) the choose part doesn’t load the chosen gadgets however I used the precisely identical code (with completely different entity) in one other CRUD in the identical system and its works tremendous.
I attempted to make use of a variety of several types of assortment (enumerable, readonlylist, record, and so on) to create the chosen gadgets record however nothing works