title: How to stop user loading page that contains RenderBody() directly
body: <p>I have an Umbraco site with the following structure:</p>
  
  <pre><code>Views/LayoutPageA.cshtml/
  Views/ContentPageA.cshtml/
  Views/ContentPageB.cshtml/
  </code></pre>
  
  <p>LayoutPageA contains:</p>
  
  <pre><code>&lt;body&gt;
      ...
      RenderBody()
      ...
  &lt;/body&gt;
  </code></pre>
  
  <p>and ContentPageA and ContentPageB both contain:</p>
  
  <pre><code>@{
      Layout = "LayoutPageA.cshtml";
  }
  </code></pre>
  
  <p>Obviously, if I navigate to <code>/LayoutPageA/ContentPageA/</code> or <code>/LayoutPageA/ContentPageB/</code> the page loads fine but <code>/LayoutPage/</code> will crash because:</p>
  
  <blockquote>
    <p>The file "~/Views/LayoutPageA.cshtml" cannot be requested directly because it calls the "RenderBody" method.</p>
  </blockquote>
  
  <p>How should I prevent the user from navigating to <code>/LayoutPage/</code> through the URL?</p>