在bootbox之前,我在gridview中的aspx文件中做了這個;Bootbox確認:返回客戶端結果爲了做回發到rowCommand
<asp:Button ID="btnDelete" CssClass="btn btn-danger" OnClientClick="if(!confirmDelete()) return false;" runat="server" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CausesValidation="false" CommandName="DeleteRow" Text="Delete"/>
and on js file;
function confirmDelete() {
return confirm("Are you sure you want to delete the record?"); }
並且通過確認,gridview的RowCommand被觸發並且刪除完成。
隨着bootbox,我真的卡住了。我知道bootbox是asynchronus並嘗試使用'preventDefault',但它不起作用。那麼如何將上述js文件轉換爲bootbox版本? 在此先感謝。