I want replace standart confirm dialog. My javascript function is in the MasterPage.
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");
});
}
I want call checkDelete function in the content page.How i use sweet alert in gridview templatefield button?
<asp:TemplateField ItemStyle-Width="60" HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="lbDelete" Runat="server" OnClientClick=" return confirm('Are you sure?');" CommandName="Delete">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
Please help.