【发布时间】:2012-03-27 18:40:30
【问题描述】:
我有以下 ajax.actionlink:-
@Ajax.ActionLink("Delete", "Delete", "Answer",
new { id = answer.AnswersID },
new AjaxOptions
{
OnBegin = "deleteconfirmation1",
HttpMethod = "Post",
UpdateTargetId = @answer.AnswersID.ToString(),
OnSuccess = "deleteconfirmation",
})
以及在执行 ajax 调用之前应该显示确认消息的以下 deleteconfirmation1.js:-
function deleteconfirmation1() {
jConfirm('Deletion Confirmation', 'Are you sure you want to delete this Answer');
}
我面临的问题是,即使用户单击取消按钮,onbegin 确认也不会阻止执行 onsuccess 脚本?所以我怎样才能让 OnBegin 作为确认阶段工作,所以应用程序将等待用户选择“Ok”或“cancel”,然后再处理 ajax 调用! ?? BR
【问题讨论】:
标签: jquery ajax asp.net-mvc-3