我想替換標準確認對話框。 我的javascript函數在這裏我如何使用甜蜜警報進行確認?
function checkDelete() {
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning", showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes Delete it!",
closeOnConfirm: false
},
function() {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
}
我如何使用gridview的模板列按鈕甜蜜的警報確認功能?
<asp:TemplateField ItemStyle-Width="60" HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="lbDeleteUser" Runat="server" OnClientClick="checkDelete();" CommandName="Delete">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
斯坦達特確認功能在這裏
<asp:TemplateField ItemStyle-Width="60" HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="lbDeleteUser" Runat="server" OnClientClick=" return confirm('Are you sure?');" CommandName="Delete">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
斯坦達特確認功能捉迷藏。但甜蜜的警報確認功能未運行。請幫助
這是非標準確認
Plase幫助。
由於JavaScript中沒有「等待」,因此不可能自定義警報/確認並讓它返回一個值。您必須取消點擊操作並觸發JavaScript代碼的點擊/提交。 – epascarello
我使用http://alertifyjs.com/一直在工作 – delueg
我怎麼可以用sweetalert?請幫忙。 –