title: Passing An ASP.NET Button Click Event in SweetAlert
body: <p>I have a C# method which performs a suspend operation.</p>
  
  <pre><code> protected void SuspendButton_OnClick(object sender, EventArgs e)
      {
          var accountNumberId = DepositAccount.DepositAccountNumberId;
          var depositAccount = AccountHolders.GetAccountHolder(accountNumberId);
  
          if (depositAccount == null)
          {
              ShowFailModal("No Account Selected");
          }
  
          Common.Deposit.AccountSuspension accntSuspension = new Common.Deposit.AccountSuspension();
          accntSuspension.AuditTS = BusinessLayer.Core.DateConversion.GetCurrentServerDate();
          accntSuspension.AuditUserId = UserId;
          accntSuspension.Description = DescriptionTextBox.Text;
          accntSuspension.SuspendedDate = GetDate;
          accntSuspension.AccountNumberId = accountNumberId;
  
          if (depositAccount != null)
          {
              InsertSuspendedAccount(accntSuspension);
          }
  
      }
  </code></pre>
  
  <p>I am using BootBox for the same now</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#SuspendButton').on('click', function (evt) {
              evt.preventDefault();
              var message = "Are you sure you want to Suspend this Account?";
  
              bootbox.confirm(message, function (result) {
                  if (result === false) {
                      evt.preventDefault();
                  } else {
                     // $.showprogress("Account Suspending.Please Wait...");
                      window.__doPostBack("&lt;%= SuspendButton.UniqueID %&gt;", "");
                  }
  
              });
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the sample of SweetAlert:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>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"); 
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can i make it work like BootBox?Like in BootBox, when i press the SuspendButton, it throws a bootbox.confirm popup, and if i press O,K the underlying operation is performed.Can i do that same with SweetAlert?</p>