Ajax.BeginForm返回方法OnSuccess = "refresh"
在后台Controller里return Content("OK");
前台:
function refresh(e) { if (e.toString() == "OK") { alert("评论成功!"); window.location.href = window.location.href; } else { window.location.href = "../../UserInfo/Login?backurl=" + window.location.href; } }
原文链接:https://www.f2er.com/ajax/166234.html