I'm using the release version of ASP.net MVC and I seem to be getting this error a lot
'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
which is very odd since I can browse to System.Web.Mvc.HtmlHelper and all the extension methods are there. Even stranger is that I can compile and all the errors go away, however as soon as I start editing again they show back up. I am including
<%@ Import Namespace="System.Web.Mvc" %>
<%@ Import Namespace="System.Web.Mvc.Html" %>
in my site.master file which I found suggested somewhere but that doesn't seem to help. Any ideas? The intelisense isn't finding the extension methods either.
First, check if you are using RenderPartial method right:
<% Html.RenderPartial(...); %>
Second, check your web.config contains:
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<pages>
<namespaces>
<add namespace="System.Web.Mvc.Html" />
</namespaces>
</pages>
</system.web>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With