我有这样的表格
<table>
<thead>
<tr>
<th>Tên học sinh </th>
<th>Giáo lý viên </th>
<th>Năm Học</th>
<th>Điểm TB Học Kỳ 1 </th>
<th>Điểm TB Học Kỳ 2 </th>
<th>Điểm Tổng Kết Năm Học </th>
<th>Lớp </th>
</tr>
</thead>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset class="form-horizontal">
<tbody id="addDetails">
<tr>
<td>
@Html.DropDownList("HocSinhId", String.Empty)
@Html.ValidationMessageFor(model => model.HocSinhId, null, new { @class = "help-inline" })
</td>
<td>
@Html.DropDownList("GiaoLyVienId", String.Empty)
@Html.ValidationMessageFor(model => model.GiaoLyVienId, null, new { @class = "help-inline" })
</td>
<td>
@Html.TextBoxFor(model => model.NamHoc)
@Html.ValidationMessageFor(model => model.NamHoc, null, new { @class = "help-inline" })
</td>
<td>
@Html.EditorFor(model => model.DiemTBHK1)
@Html.ValidationMessageFor(model => model.DiemTBHK1, null, new { @class = "help-inline" })
</td>
<td>
@Html.EditorFor(model => model.DiemTBHK2)
@Html.ValidationMessageFor(model => model.DiemTBHK2, null, new { @class = "help-inline" })
</td>
<td>
@Html.EditorFor(model => model.DiemTongKetNamHoc)
@Html.ValidationMessageFor(model => model.DiemTongKetNamHoc, null, new { @class = "help-inline" })
</td>
<td>
@Html.DropDownList("LopId", String.Empty)
@Html.ValidationMessageFor(model => model.LopId, null, new { @class = "help-inline" })
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
@Ajax.ActionLink("Add", "AddDetails", new AjaxOptions
{
HttpMethod = "GET",
OnSuccess = "successCall",
@*UpdateTargetId = "addDetails",
InsertionMode = InsertionMode.InsertAfter,*@
})
</td>
</tr>
<tr>
<td colspan="6">
@*<a href="#"> </a>*@
<input type="submit" value="Lưu thông tin" class="button" />
</td>
</tr>
</tfoot>
</fieldset>
}
</table>
单击 Ajax 链接“添加”后,它将插入新行以输入新数据。
图片:http: //i808.photobucket.com/albums/zz1/nquangkhaiDST/Postmultipledata_zps5364f0a0.png
问题是:当我提交到服务器时,它只是发布第一个数据,而不是我点击“添加”后的数据。我如何从 ajax 获取所有数据甚至字段以发回服务器。
任何人都知道如何发布所有数据,甚至是 ajax 的数据。十分感谢