MVC Form异步请求

时间:2021-03-31 05:23:44
 @using (Ajax.BeginForm("CreateReviewInfo", "Review", new AjaxOptions
{
HttpMethod = "post",
OnSuccess = "BackResultReview",
OnBegin = "ShowLoading",
OnComplete = "HideLoading"
}, new { @id = "ReviewInfoForm", @role = "form", @class = "form-horizontal" }))
{
@Html.AntiForgeryToken()
<button type="submit" class="btn btn-default">添&nbsp;&nbsp;加</button>
}

在mvc-bootstrap中使用时@Scripts.Render("~/bundles/jqueryval")加上验证的js