title: Jquery Modal Dialog displaying MVC3 partial view - works first click only
body: <pre><code> public ActionResult MeanQ(int id)
  {            
      Access access= db.Access.Find(id);
      return PartialView("_MeanQPartial", access);
  }
  </code></pre>
  
  <p>The partial view thats being rendered in the above code is displayed in a Dialog Modal (Jquery)...The link(onclick) that displays the partial view in a Jquery Modal Dialog works well for the first click. Once I close that dialog and click on the link again, the Partial View  does not open as expected in a pop up form. It opens as a new page in the browser. How can I make the pop up modal dialog link work the same way every time? </p>
  
  <p>Javascript code is below (Jquery Modal Dialog):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function () {
      //initialize the dialog
      $("#result").dialog({ width: 400, resizable: true, position: 'center', title: 'Access info', autoOpen: false,
          buttons: { "Ok": function () { $(this).dialog("close"); } }
      });
  });
  
  $(function () {
      $('#modal').click(function () {
          //load the content from this.href, then turn it into a dialog.
  
          $('#result').load(this.href).dialog('open');
          return false;
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>HTML Link that triggers the modal dialog:</p>
  
  <pre><code>@Html.ActionLink("PopUp", "MeanQ", new { id = item.AccID }, new { id = "modal" })
  </code></pre>