sweet alert confirm dialog in asp.net

后端 未结 1 664
天命终不由人
天命终不由人 2021-01-26 04:48

I am able to get the alerts for isConfirm both true and false in sweet alert but unable to pass the same to btnSave to call btnSave_Click method in codebehind. Please help. Usin

1条回答
  •  一向
    一向 (楼主)
    2021-01-26 05:42

    Please try below changes in your code

    
    

    and in Script of sweet alert

    function (isConfirm) {
                    if (isConfirm) {
                        return true; 
                        // alert("true");
                       // $(this).trigger('click');
                        $("#<%= btnSave.ClientID %>").trigger('click');
                       // e.currentTarget.submit();
                    } else {
                          return false; 
                        // alert("False");
                    }
                }
    

    0 讨论(0)
提交回复
热议问题