title: How do I prevent closing of jQuery modal dialog when asp buttons inside dialog are clicked?
body: <p>I am attempting to resolve an issue for a jQuery UI modal dialog that contains several asp controls which have server side events.  Each time an asp control inside the dialog is clicked, the modal dialog closes.  These asp controls do have server side logic that just execute to interact with the modal.</p>
  
  <p>I have included the logic to append the dialog to the form (see below).  The appendTo works well for other dialogs in my solution that have controls that postback.</p>
  
  <p>The only difference for this modal is that the Div is contained inside a user control. </p>
  
  <p>Below is the script used to open the dialog:</p>
  
  <pre><code>var $splitdialog;
  
  // render html using web service, then GetSplitViewComplete will open the modal dialog
  
  openDistributedReferenceCodesSplitModalDialog = function (splitdialogDivId, EntityType, EntityId, AllowAdd, AllowAdhoc) {
      $splitdialog = $("#" + splitdialogDivId);
      $splitdialog.empty();
      WebServices.DistributedReferenceCodesService.GetSplitView(EntityType, EntityId, AllowAdd, AllowAdhoc, GetSplitViewComplete);
  };
  
  GetSplitViewComplete = function (result) {
      // neccessary to support postback for button, dropdowns, etc on modal
      $splitdialog.append(result.InnerHtml);
      $splitdialog.dialog({ width: 800 }, { height: 'auto' }, { modal: true });
      $splitdialog.parent().appendTo($("form:first"));
  };
  </code></pre>
  
  <p>Your suggestions are appreciated.</p>