I have the problem that when I click the Register button, the City does not pass the ID. Made. The ID is being passed to the screen, but at the time of passing to the controller not.
<div class="alinhado col-md-4">
<div class="form-group">
<div class=" alinhadoLabel">
@Html.Label("Cidade", htmlAttributes: new { @class = "control-label" })
</div>
<div class="alinhadoEditor">
<select class="form-control" id="City"><option value="0">Selecione</option></select>
</div>
</div>
</div>
This is the controller:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "PeopleID,Name,Email,Password,Address,Number,Neighborhood,ZipCode,Photo,Type,Active,Validate,DateBirth,Register,CityID")] People people)
{
if (ModelState.IsValid)
{
db.Peoples.Add(people);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(people);
}
and here is the error: