title: Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'
body: <p>I am using jQuery UI to render an ASP.NET MVC 5 partial view into an empty div:</p>
  
  <pre><code>$(document).ready(function () {
      $(".SiteName").on("click", function (event) {
          event.preventDefault();
          var siteName = $(this).data("sitename");
          //alert(siteName);
          $.ajax({
              url: "/EtlLog/ListSiteJobs?SiteDescription=" + encodeURIComponent(siteName),
              type: "GET",
          })
          .done(function (result) {
              $("#ListSite").html(result).dialog("open");
          });
      });
  })
  </code></pre>
  
  <p>Inspecting the ListSite div after the click, I see that it is filled with the expected results but I get a jQuery UI error:</p>
  
  <pre><code>Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' 
  </code></pre>
  
  <p>I've tried various combinations of .ready() and even nesting the div being rendered within a div used for .dialog(). Must have looked at every question about this error, but still not finding a solution.</p>