@using (Ajax.BeginForm("Form", "Observation", new { area = "" }, new AjaxOptions
{
HttpMethod = "POST",
OnComplete = "EditAjaxEnd", // standard function name to becalled to end gif loading
OnBegin = "EditAjaxStart" // standard function name to becalled to call gif loading
}, new { id = "frmAddEdit", @class = "form-horizontal" })) // always name the form for UI block
{
Html.RenderPartial("FormReporter");
}
在FormReporter局部视图中,我有一个按钮
<button type="submit" id="btnSave" class="btn btn-lg blue"
onclick="return CheckAndSubmit();">Save</button>
每次我点击保存动作控制器按两次,以便将记录保存两次。
部分视图需要做些什么吗?