我的项目有一个显示多行的主窗体。在下面的示例中,id = "Grid"* 的 div 将被包含表格的部分视图替换。该表单是一个 Ajax 表单并且是强类型的。有没有办法只将已修改的行发送回控制器并让模型只包含这些行?
@model Models.myModel;
@using (Ajax.BeginForm("Save", "myController", new AjaxOptions { HttpMethod = "Post", UpdateTargetId = "AllGrids" }, new { id = "frm" }))
{
<div id="AllGrids">
<table id="EvidenceGrids" style="width: 1200px">
<tr>
<td style="border-style: solid; border-width: thin">
<div id="Grid1"></div>
</td>
</tr>
<tr>
<td style="border-style: solid; border-width: thin">
<div id="Grid2"></div>
</td>
</tr>
<tr>
<td style="border-style: solid; border-width: thin">
<div id="Grid3"></div>
</td>
</tr>
</table>
</div>
}
public ActionResult Save (Model m)
{
use model as needed
}