-1
I created a register where an object has n elements and each of them is selected from a Dropdown, the registration works perfectly but when I edit the Dropdowns do not show the selected item according to what was saved in the Database:
Follow the view code:
for (var i = 0; i < Model.vehicletanks.Count; i++)
{
@Html.DropDownListFor(model => model.vehicletanks[i].fueltype, (IEnumerable<SelectListItem>)ViewBag.FuelTypeSelectList, Resources.Select, new { @class = "form-control" })
}
If I replace the "Dropdownlistfor" with an "Editorfor" it brings the value correctly, "fueltype" is an integer from 0 to 14.