title: Render Partial View in Bootstrap Popover Content
body: <p>In my MVC View I have the following:</p>
  
  <pre><code>&lt;a href="#" tabindex="0" data-toggle="popover" data-trigger="hover" data-container="body" data-html="true" data-content="@Html.Action("Popover","Client")"&gt;Simon Jones&lt;/a&gt;
  </code></pre>
  
  <p>This works as I want it, loading the partial View returned by the <em>Popover</em> Action in the <em>Client</em> Controller. However, I would like it so that, with minimal effort, wherever the client's name appears in the application, this popover is added near enough automatically. Something like:</p>
  
  <pre><code>&lt;a href="#" class="clientPopover"&gt;Simon Jones&lt;/a&gt;
  </code></pre>
  
  <p>With Javascript in a separate file, linked to each page, like this:</p>
  
  <pre><code>$(".clientPopover").popover({
      html: true,
      container: 'body',
      trigger: 'hover',
      content: '@Html.Action("Popover","Client")'
      })
  </code></pre>
  
  <p>I realise that I can't use the HTML Helper in the Javascript as I have written it here, but I have tried a multitude of different ways to accomplish this, without success.</p>
  
  <p>The key requirement is that I can very easily specify that an element should have a popover attached which renders a partial view in its content. I will want to achieve the same thing with different items of data throughout the application, not just clients, so what I'm aiming for is one place to store the location of the partial views for the popovers for each item of data (e.g. client, staff, building, etc.).</p>
  
  <p><strong>EDIT:</strong>
  I simplified my requirements to make this question easier to understand, but I realise now that this has led to an answer which works for my simplified problem but not my actual problem. It's been suggested that I could load the Popover content into a hidden element on the page and then display this in the Popover as required. However, in practice my page may have lots of different clients' names displayed at the same time (e.g. in a table), and hovering over each name would display that client's details in the Popover. I could use Ajax to update the content of my hidden element each time before populating the Popover, but I doubt that's going to be very performant, and feels over complicated.</p>
  
  <p>What I was originally hoping was that once I'd figured out how to call the Action to load the Popover content for one client, I'd be able to extend the solution to also pass the id of client, so that the data for the Popover was loaded dynamically. I really thought this would be simpler than it seems to be!</p>