c# - How to show Confirmation message in jquery on button click event -


i developing web application in asp.net. requirement show confirmation message on every button click event (insert,update , delete buttons). using jquery message box in through out application successfull insert,update , delete.

    function messagebox(title, innertext) {     try {         var dialog = $('<p class="messagebox">' + innertext + '</p>').dialog({             title: title,             width: "240",             modal: true,             buttons: {                 "ok": function () {                     dialog.dialog('close');                 }             }         });     }     catch (e) {         messagebox('tracker alert', e);     } } 

call on button click event

result = save_updatedata(2);  if (result > 0)    {                   scriptmanager.registerstartupscript(this, gettype(), "msg", "messagebox('tracker alert', 'record updated succesfully');", true);      } 

then, how show confirmation message on button click event using jquery message box same above function.

please me out. in advance.

  <script type="text/javascript">       $(window).on('mouseover', (function () {           window.onbeforeunload = confirmleave;       }));       $(window).on('mouseout', (function () {           window.onbeforeunload = confirmleave;       }));       function confirmleave() {                    return "";       }  var prevkey = "";   $(document).keydown(function (e) {       if (e.key == "f5") {           window.onbeforeunload = confirmleave;       }       else if (e.key.touppercase() == "w" && prevkey == "control") {           window.onbeforeunload = confirmleave;       }       else if (e.key.touppercase() == "r" && prevkey == "control") {           window.onbeforeunload = confirmleave;       }       else if (e.key.touppercase() == "f4" && (prevkey == "alt" || prevkey == "control")) {           window.onbeforeunload = confirmleave;       }       prevkey = e.key.touppercase();   }); </script> 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -