【发布时间】:2011-10-06 11:24:41
【问题描述】:
我有一张简单的桌子
@using (Html.BeginForm("Save", "Subscription", FormMethod.Post))
{
<table>
<tr>
<th>
Name
</th>
<th>
Report
</th>
</tr>
@foreach (var item in Model.ReportSubscriptions)
{
<tr>
<td>
@Html.HiddenFor(item.Id)
@Html.TextBoxFor(item.Name)
</td>
<td>
@Html.TextBoxFor(item.Report)
</td>
</tr>
}
</table>
<button type="submit">Save</button>
}
保存动作
public ViewResult Save(IEnumerable<ReportSubscription> list)
{
throw new NotImplementedException();
}
}
如何让 MVC 将帖子反序列化回我的模型?
【问题讨论】:
标签: asp.net-mvc-3 html-table controller-action