title: sweet alert confirm dialog in asp.net
body: <p>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. Using latest sweetalert, downloaded from <a href="http://t4t5.github.io/sweetalert/" rel="nofollow noreferrer">http://t4t5.github.io/sweetalert/</a> .</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $('body').on('focus', ".Datetext", function () {
              $(this).datepicker();
          });
  
          function Confirm(th, e) {
                e.preventDefault();
              swal({
                  title: "Are you sure?",
                  text: "You want to Save this project?",
                  type: "warning",
                  showCancelButton: true,
                  confirmButtonColor: '#DD6B55',
                  confirmButtonText: 'Yes, I am sure!',
                  cancelButtonText: "No, cancel it!",
                  closeOnConfirm: true,
                  closeOnCancel: true
              },
              function (isConfirm) {
                  if (isConfirm) {
                      //return true; 
                       alert("true");
                     // $(this).trigger('click');
                      $("#&lt;%= btnSave.ClientID %&gt;").trigger('click');
                     // e.currentTarget.submit();
                  } else {
                      //  return false; 
                      // alert("False");
                  }
              });
          } 
      &lt;/script&gt; 
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;div style="text-align: center;"&gt;
                  &lt;asp:Button ID="btnSave" CssClass="buttons___" runat="server" Font-Size="9pt" Text="Save Project" 
                      OnClick="btnSave_Click" OnClientClick="Confirm(this, event);"/&gt;
                  &lt;asp:Button CssClass="buttons___" runat="server" Font-Size="9pt" Text="Save as Draft" /&gt;
              &lt;/div&gt;
  </code></pre>