I made a model, some fields and a button in the view:
View:
@model IEnumerable<EnrollSys.Employee>
@foreach (var item in Model)
{
@Html.TextBoxFor(modelItem => modelItem.name)
}
<input type="submit" value="Save" class="btn btn-default" style="width: 20%" />
Controller:
public ActionResult Index()
{
var model = selectModels();
return View(model);
}
[HttpPost]
public ActionResult Save(IEnumerable<EnrollSys.Employee> model)
{
return View();
}
The problem is:
Why the "Save" action isn't fired?
See Question&Answers more detail:os