title: Partial View SPA for Some Pages With a RenderBody for Others
body: <p>I have a MVC 4 (Razor) app that is being converted to resemble more of a SPA single page app. It is not purely a SPA -- 5 of the pages use Ajax to load in the body section, while other one-off pages are not required to use Ajax.</p>
  
  <p>I have everything working except for the home Index page. I need to link back to the index, but I'd like to keep using one layout master page. The problem is that I cannot figure out how to sometimes load the partial views and then other times render the page with the layout master.</p>
  
  <p>I need to keep the @RenderBody for the non-Ajax pages.</p>
  
  <pre><code>&lt;body&gt;
     &lt;section id="BodySection"&gt;
       @RenderBody 
     &lt;/section&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>For the Ajax pages, on nav button click I Ajax the partial view into #BodySection using JQ.</p>
  
  <pre><code>function LoadPage(actionarg, controllerarg) {
          var link = '@(Url.Action("action", "controller"))';
          link = link.replace("action", actionarg);
          link = link.replace("controller", controllerarg);
  
          $.ajax({
              url: link,
              type: "POST",
              cache: false,
              async: true,
              data: { data: '' },
              success: function (result) {
                  $("#BodySection").html(result);
              }
          });
      }
  </code></pre>
  
  <p>How can I mix the two types of page loading?</p>