I have model MyObject and then in the view I have
@model IEnumerable<MyProject.Models.MyObject>
and then further down a form :
@using(Html.BeginForm())
{
@foreach(MyObject m in Model)
{
@Html.TextboxFor(x => x.Name)
}
}
<input type="submit" value="modify" />
I am trying to get this in my controller like this:
[HttpPost]
public void Update(MyObject _myOject)
{
}
When I see the source code, all name is repeated and _myObject is not correctly populated
how do I update a list of objects and save them all at once in MVC?