title: How to get the Focus on one of Buttons of JQuery Dialog on ASP.NET MVC page?
body: <p>I have an ASP.NET MVC page(Registration). On loading the page, i am calling Jquery Dialog with <strong>Agree</strong> and <strong>Disagree</strong> buttons on that Dialog.</p>
  
  <p>1). How to set the <strong>focus to Agree button</strong> by default?</p>
  
  <p>2). How to disable the <strong>X (Close) Mark</strong> that is on Top right corner? (So that i don't want the user to close that dialog simply).</p>
  
  <p>Code:</p>
  
  <pre><code>$("#dialog-confirm").dialog({
          closeOnEscape: false,
          autoOpen: &lt;%= ViewData["autoOpen"] %&gt;,
          height: 400,
          width: 550,
          modal: true,
          buttons: {
              'Disagree': function() {
                  location.href = "/";
              },
              'Agree': function() {
                  $(this).dialog('close');
                  $(this).focus();
              }
          },
          beforeclose: function(event, ui) {
              var i = event.target.id;
              var j = 0;
          }
      });        
  </code></pre>
  
  <p>Appreciate your responses.</p>
  
  <p>Thanks</p>