ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2018 All rights reserved.Call Server side code on Sweet Alert Confirm Button using jQuery Ajax in ASP.Net<p>Hi <a class="username" rel="crajesh">crajesh</a>,</p> <p>I have tried your code and it seems like event.preventDefault once executed then it doesnt allow to run the server side code so for that you can do one thing is make a ajax call in the function of swal and achieve your task like below you can achieve it</p> <pre class="brush: js">&lt;script type=&#34;text/javascript&#34;&gt; function Swal_Confirm_Msg1(ctl, event, title_msg, text_msg, btn_type) { event.preventDefault(); swal({ title: title_msg, text: text_msg, type: btn_type, showCancelButton: true, confirmButtonClass: &#34;btn-danger&#34;, confirmButtonText: &#34;Yes, delete it!&#34;, cancelButtonText: &#34;No, cancel plx!&#34;, showLoaderOnConfirm: true, animation: &#39;slide-from-top&#39;, allowEscapeKey: false, allowOutsideClick: false, html: true }, function (isConfirm) { if (isConfirm) { //Do your stuff if clicked yes. $.ajax({ type: &#34;POST&#34;, url: &#34;YourPageName/YourMethodName&#34;, data: &#34;Data you want to pass&#34;, contentType: &#34;application/json; charset=utf-8&#34;, dataType: &#34;json&#34;, success: function (response) { //response will return the value you assigned while returning on success call of ajax. }, error: function (response) { // reponse will return server side error message. } }); } else { //Do your stuff if clicked No. } }); } &lt;/script&gt;</pre> <p>&nbsp;</p>, 05 Jan 2017 07:19:01 GMT