using (Ajax.BeginForm("SaveTimeShift", new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "recordList", InsertionMode = InsertionMode.Replace }))
为什么当我在上面使用这个重载的 Ajax.BeginForm 构造函数时,我在我的模型中获得了更新的数据,但是当我在下面使用这个重载的构造函数时,我没有得到我的模型的更新值?我需要下面的构造函数才能设置表单的 html 类属性...
using (Ajax.BeginForm("SaveTimeShift", @Model, new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "recordList", InsertionMode = InsertionMode.Replace }, new { @class = "form-inline" }))
{
@Html.TextBoxFor(model => model.StartDate, new { id = "startDate", @readonly = true, width = "100px" })
@Html.HiddenFor(model => model.SelectedName, new { id = "selectedName" });
@Html.HiddenFor(model => model.SelectedUserId, new { id = "selectedUserId" });
<input class="btn btn-primary pull-right" type="submit" value="Save Time Shift" />
}