Hi , im trying to put a drop-down list to work on asp.net 5 with no luck, maybe someone can help.
Thanks In advance
Here's the code:
Controller Code:
// GET: WorkingDays/Create
public IActionResult Create()
{
ViewData["LocationID"] = new SelectList(_context.Location, "LocationID", "Location");
ViewData["VehicleID"] = new SelectList(_context.Vehicle, "VehicleID", "Vehicle");
ViewData["WorkerID"] = new SelectList(_context.Worker, "WorkerID", "Worker");
return View();
}
View Code:
<div class="form-group">
<label asp-for="Location" class="col-md-2 control-label"></label>
<div class="col-md-10">
<select asp-for="Location" asp-items="?????" class="form-control" ></select>
</div>
</div>