title: How to use Sweet Alert in ASP.NET C#
body: <p>I am trying to use the sweet alert to use as a pop-up message in my ASP.NET C# application. But I think I am doing wrong because, If I click the button or Link button, nothing really happens. it's just like an element without an event. </p>
  
  <p>So here is the code. </p>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>&lt;script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          function Confirm(ctl, event) {
              event.preventDefault();
              swal({
                  title: "Confirm Logout?",
                  text: "Do you really want to log this Account out?",
                  type: "warning",
                  showCancelButton: true,
                  closeOnConfirm: true,
                  closeOnCancel: true
              },
              function (isConfirm) {
                  if (isConfirm) {
                      return true;
                  } else {
                      return false;
                  }
              });
          }
      &lt;/script&gt;
  </code></pre>
  
  <p><strong>ASPX</strong></p>
  
  <pre><code>    &lt;li class="nav-item"&gt;
    &lt;asp:LinkButton ID="btnLogout" CssClass="nav-link" runat="server" OnClick="btnLogout_Click" OnClientClick="return Confirm(this,event)"&gt;&lt;i class="icon ion-android-exit"&gt;&lt;/i&gt;&lt;/asp:LinkButton&gt;&lt;/li&gt;
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code> protected void btnLogout_Click(object sender, EventArgs e)
      {
           Session.Abandon();
           Response.Redirect("login.aspx");
      }
  </code></pre>