hi ,
Can help me , why confirm does't work when call function DeleteClick, i using fom popup
do you have solution
thanks
<div>
<script type="text/javascript" src="../js/sweetalert/sweetalert.min.js"></script>
<link href="../js/sweetalert/sweetalert.min.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
function functionConfirm(event) {
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!',
cancelButtonText: 'No, cancel!',
confirmButtonClass: 'btn btn-success',
cancelButtonClass: 'btn btn-danger',
buttonsStyling: false
}).then(function (result) {
if (result) {
$.ajax({
type: "POST",
url: "editgroupshiftfrom.aspx/DeleteClick",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
swal("Data Transfered SuccessFully", r.d, "success");
}
});
}
},
function (dismiss) {
if (dismiss == 'cancel') {
swal(
'Cancelled',
'Your imaginary file is safe :)',
'error')
}
});
}
</script>
</div>
<System.Web.Services.WebMethod()>
Public Shared Function DeleteClick(ByVal id As Integer) As String
msgbox("hallo")
End Function
<div>
<asp:ScriptManager ID="ScriptManager" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>
<asp:Button ID="btnSweetAlert" runat="server" Text="Delete" OnClientClick="return functionConfirm();"/>
</ContentTemplate>
</asp:UpdatePanel>
</div>