title: undefined is not a function Error: $('#dialog').dialog({?
body: <p>i am having error that says   <code>$("#dialog").dialog({</code>is undefined 
  i did the same thing in a new MVC project and it works. but when i move the same code to another MVC project i am getting this error.
  please help. I have added the jquery UI script. But still i get the same error.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
           &lt;link href="~/Content/jquery-ui.css" rel="stylesheet" /&gt;
          &lt;script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
          &lt;body&gt;
              &lt;form class="form-horizontal" role="form"&gt;
  .......
   &lt;/form&gt;
  &lt;div id="dialog" title="Create Album" style="overflow: hidden;"&gt;&lt;/div&gt;
          &lt;/body&gt;
  @section scripts{
      &lt;script type="text/javascript"&gt;
          var InitialFacility = '@ViewBag.ID';
          $(document).ready(function () { 
  
              $('#tabs a').click(function(e) {
                  e.preventDefault();
                  $(this).tab('show');
              });
  
         $("#dialog").dialog({
  
                  autoOpen: false,
                  width: 400,
                  resizable: false,
                  title: 'hi there',
                  modal: true,
                  open: function (event, ui) {
                      //Load the CreateAlbumPartial action which will return 
                      // the partial view _CreateAlbumPartial
                      $(this).load('@Url.Action("GetRrfForm","FacilityAdd")');
                  },
                  buttons: {
                      "Close": function () {
                          $(this).dialog("close");
                      }
                  }
              });
  
              $('#modal-opener').click(function () {
                  $('#dialog').dialog('open');
              });
          });
  
  
      &lt;/script&gt;
  }
  &lt;div id="dialog" title="Create Album" style="overflow: hidden;"&gt;&lt;/div&gt;
  </code></pre>