I am having an issue with the HTML helper BeginCollectionItem
. It seems to be binding the item to the view but and changes are not being propagated.
I have a partial view and the model that is bound to it is an IEnumerable
. Below is a snippet.
<tbody>
@foreach (var entry in Model) {
<tr>
@using (Html.BeginCollectionItem("EditedEntries")) {
<td>@entry.Storeid</td>
<td>@entry.district</td>
<td>@Html.EditorFor(x => entry.AdjHrs)</td>
}
</tr>
}
</tbody>
If I remove the the foreach
it works, however I need to use a foreach
because a collection is returned to the partial view from the Ajax call along with the table and its members.