使用
OnSuccess并摆脱
UpdateTargetId。像这样:
@using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { HttpMethod = "Post", onSuccess = "foo" })){ ...}然后:
function foo(result) { if (result.SomePropertyThatExistsInYourJsonObject) { // the server returned a JSON object => show the dialog window here } else { // the server returned a partial view => update the DOM: $('#DivFormId').html(result); }}


