0

在控制器中,我StudentID从视图的 POST 方法中获取。基本上这条线是:

public ActionResult Edit(int? StudentID) {}

在视图中,我有一个隐藏字段来提供StudentID. 当我更改行时,在 View() 中的原因是什么:

using(Html.BeginForm()) { //... }

using (Html.BeginForm("Edit", "Students", FormMethod.Post, new { @class = "form-horizontal" }))

停止ModelBinder绑定StudentID。当我提交表格时,我收到null的不是正确的学生证。

4

0 回答 0