You need an item <form>to submit your controls. In your case, you need to specify the name of the action, because its not the same as the thet method generated the view ( Index())
@using (Html.BeginForm("Save"))
{
....
}
Save(), , foreach name , , ( html - id).
for ( IList) EditorTemplate Employee.
for
@model IList<EnrollSys.Employee>
@using (Html.BeginForm("Save"))
{
for (int i = 0; i < Model.Count; i++)
{
@Html.TextBoxFor(m => m[i].name)
}
<input type="submit" value="Save" class="btn btn-default" style="width: 20%" />
}
EditorTemplate
/Views/Shared/EditorTemplates/Employee.cshtml
@model EnrollSys.Employee
@Html.TextBoxFor(m => m.name)
@model IEnumerable<EnrollSys.Employee>
@using (Html.BeginForm("Save"))
{
@Html.EditorFor(m => m)
<input type="submit" value="Save" class="btn btn-default" style="width: 20%" />
}