@using (Ajax.BeginForm("GetTime","order",new AjaxOptions()
{
Confirm="你确认这么做吗?",
HttpMethod="post",
OnSuccess = "afterajax",
UpdateTargetId="result",
InsertionMode=InsertionMode.Replace,
LoadingElementId = "loading",
}))
{
}
Html部分代码
$(function () {
$("#loading").css("display", "none");
$("#btnGetTime").click(function () {
$.ajax({
url: "/order/GetTime",
data: {},
type: "post",
success: function (data) {
alert(data);
}
});
$.get("/order/GetTime", {}, function (data) {
alert(data);
});
}
)
});
function afterajax(data) {
alert("ff");
}
function aff() {
$("#loading").css("display", "none");
}