2012-07-24 66 views
1

我使用的是預定義的jQuery css表單模板。確認框jquery

<asp:Button ID="btndeleteselected" runat="server" Text="Delete" 
    CssClass="basicBtn mr10 ml10 bConfirm" OnClick="btndeleteselected_Click" /> 

當我點擊按鈕我需要顯示確認框刪除。但是當我點擊按鈕

事件觸發未獲得確認框。我需要做什麼?

我的jQuery功能

$(".bConfirm").click(function() { 
    jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) { 
     jAlert('Confirmed: ' + r, 'Confirmation Results'); 
    }); 
}); 

它在custom.js通過調用傳遞給點擊事件preventDefault() defiend預定義的jQuery文件

回答

2

你需要告訴click事件不處理,處理者:

$(".bConfirm").click(function(e) { 
    jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) { 
     jAlert('Confirmed: ' + r, 'Confirmation Results'); 
    }); 
    e.preventDefault(); 
    return false 
});