4
Asp.netプロジェクトのすべてのページで使用される単純なJavaScript確認関数を使用しています。をjQueryの確認ダイアログに置き換えます。 Apprise jQuery確認ダイアログライブラリを使用します。 しかし、jQueryの確認ダイアログの非同期作業によって問題が発生します。 これは私の新しい非同期jQueryのダイアログ機能に非同期JQueryの確認ダイアログを同期として使用する方法は?
function confirmForOperation(message) {
apprise(message, { 'verify': true, 'animate': true, 'textYes': 'Yes', 'textNo': 'No' },
function (r) {
if (r) {
// User clicked YES..
return true;
}
else {
// User clicked NO..
return false;
}
});
}
を確認している
function confirmForOperation(message) {
if (confirm(message) == true)
return true;
else
return false;
}
私の古いJavaScriptのconfirm関数これは
..です私はあなたに私のプロジェクトのいくつかのコードの例を挙げてみましょう
下記の機能をご利用いただける場合があります
function confirmForOperation(message, callBack) {
apprise(message, { 'verify': true, 'animate': true, 'textYes': 'Yes', 'textNo': 'No' },
function (r) {
if (r) {
// User clicked YES..
if ($.isFunction(callback)) {
callback.apply();
}
}
else {
// User clicked NO..
return false;
}
});
}
しかし、コールバックメカニズム私は、この確認ダイアログ機能を使用した領域(コード)の一つは以下の通りですので、私のために動作しません:
<asp:Button ID="btnDelete" runat="server" CausesValidation="false" CommandName="Delete"
Text="<%$ Resources:BTNResource, BUTTON_DELETE_LABEL %>" OnClientClick="return confirmForOperation();" />
任意のアイデア?