title: MVC Razor RenderPartial Call Not Working in Website
body: <p>I am trying to include some reusable code throughout my website (not web application) via the RenderPartial call @Html.RenderPartial("SomePage.cshtml").  In asp I was just able to use #include virtual="somefile.asp".  However, I receive the following error message.</p>
  
  <blockquote>
    <p>Compiler Error Message: CS1061: 'System.Web.WebPages.Html.HtmlHelper'
    does not contain a definition for
    'RenderPartial' and no extension
    method 'RenderPartial' accepting a
    first argument of type
    'System.Web.WebPages.Html.HtmlHelper'
    could be found (are you missing a
    using directive or an assembly
    reference?)</p>
  </blockquote>
  
  <p>I have include all the appropriate references in my web.config file. </p>
  
  <pre><code>    &lt;compilation debug="true" targetFramework="4.0"&gt;
          &lt;assemblies&gt;
              &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
              &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
              &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
              &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
              &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;/assemblies&gt;
      &lt;/compilation&gt;       
      &lt;pages&gt;
          &lt;namespaces&gt;
              &lt;add namespace="System.Web.Mvc"/&gt;
              &lt;add namespace="System.Web.Mvc.Html"/&gt;
              &lt;add namespace="System.Web.Routing"/&gt;
              &lt;add namespace="System.Collections.Generic"/&gt;
          &lt;/namespaces&gt;
      &lt;/pages&gt;
  </code></pre>
  
  <p>Is the RenderPartial only available in "Web Applications" and not "Websites"?<br>
  Is there a better way to reuse code throughout the site?<br>
  @RenderSection does not work in my situation since the layout I'm using does not reuse the code in the same location.</p>