OnBeginでしばらくAjax.ActionLinkの ajax リクエストの送信を停止し、確認アラートが true の場合はリクエストを続行する必要があります。以下のコードでは、ajax リクエストを中止できます。独自のメソッドを使用して再送信する方法はありますか。
beforeDelete: function (x, y) {
x.abort();
bootbox.confirm("Are you sure you want to delete this?", function (result) {
if (result) {
//process again
}
});
}
編集: 私はそれを達成しました、Guruprasadに感謝します。
var prevDel = true;
function beforeDelete(x, y) {
if (prevDel) {
x.abort();
bootbox.confirm("Are you sure you want to delete this?", function (result) {
if (result) {
prevDel = false;
$.ajax(y);
} else {
prevDel = true;
}
});
} else {
prevDel = true;
}
}