title: How do I make an ASP.NET postback-confirmation dialog with jQuery?
body: <p>i am using the below code to get a Jquery UI popup, but its not returning the value and popup box is closing</p>
  
  <p>I need when i click on button it has to work as confirmation box..!</p>
  
  <p>Code :</p>
  
  <pre><code>&lt;style type="text/css" &gt;
          .ui-widget-header, .ui-widget-content
      { color: red !important;}
  &lt;/style&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          var $myDialog = $('&lt;div&gt;&lt;/div&gt;')
          .html('You are going to Lock the Record.&lt;br/&gt;Click OK to confirm.  Click Cancel to stop this action.')
          .dialog({
              autoOpen: false,
              title: 'Confirm..?',
              buttons: { "OK": function () {
                  $(this).dialog("close");
  
              }, "Cancel": function () {
                  $(this).dialog("close");
  
              }
              }
          });
  
          $(function fn() {
              $('#Button1').click(function (e) {
                  return $myDialog.dialog('open');
  
              });
          });
      });
  &lt;/script&gt;
  
  
  &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return fn() onclick="Button1_Click"/&gt;
  </code></pre>