Visual Studio 2013 doesn't recognize Html.RenderPartial
I am using Visual Studio 2013 with Umbraco 7.2.4. I can create a template (view) through the back-end and everything works. But when I go into Visual Studio to edit the template, I get the following error for Html.RenderPartial:
'System.Web.Mvc.HtmlHelper<Umbraco.Web.Models.RenderModel>' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<Umbraco.Web.Models.RenderModel>' could be found (are you missing a using directive or an assembly reference?)
I looked in the references for the project and I see a System.Web.Mvc.Html, but I don't see System.Web.Mvc.HtmlHelper. I have MVC 5.2.3 installed and I have run all of the NuGet package updates.
The website works fine, I just get this error in Visual Studio. I tried resetting the visual studio settings as well as deleting the .suo file for the project. neither worked.
Hmm, check your Views folder: It should contain a web.config file with reference to default namespaces and pageBaseType, if it's missing or is blank, or not included in the solution, then you'll get the error messages you are reporting; might not be cause of your problem but worth checking.
Thanks for the suggestion. The web.config file does exist and the following entries are included, so I don't think this is the issue (unless I am missing a namespace).
As I was watching some of the surfaccontroller videos, I realized some of the other classes were also showing errors, so I decided to start a new project and try again. I came across some posts online saying mvc 5 is supported in umbraco 7.2, but only if you start with .net mvc 4 and then upgrade to mvc 5. On my new project, I started with an MVC 4 project. Then I installed umbraco and finally I updated to MVC 5 (via nuget). This resolved the issue.
Visual Studio 2013 doesn't recognize Html.RenderPartial
I am using Visual Studio 2013 with Umbraco 7.2.4. I can create a template (view) through the back-end and everything works. But when I go into Visual Studio to edit the template, I get the following error for Html.RenderPartial:
'System.Web.Mvc.HtmlHelper<Umbraco.Web.Models.RenderModel>' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<Umbraco.Web.Models.RenderModel>' could be found (are you missing a using directive or an assembly reference?)
I looked in the references for the project and I see a System.Web.Mvc.Html, but I don't see System.Web.Mvc.HtmlHelper. I have MVC 5.2.3 installed and I have run all of the NuGet package updates.
The website works fine, I just get this error in Visual Studio. I tried resetting the visual studio settings as well as deleting the .suo file for the project. neither worked.
Any ideas?
Thanks.
Hi Jeremy Bodager,
instead of
you could just do
Hope this is usefull
Regards,
Mehul Gajjar.
Same "error" message with:
@{ Html.Partial("umbHomepageBanner"); }
Except my partial doesn't get loaded now.
Hmm, check your Views folder: It should contain a web.config file with reference to default namespaces and pageBaseType, if it's missing or is blank, or not included in the solution, then you'll get the error messages you are reporting; might not be cause of your problem but worth checking.
Thanks for the suggestion. The web.config file does exist and the following entries are included, so I don't think this is the issue (unless I am missing a namespace).
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Umbraco.Web" />
<add namespace="Umbraco.Core" />
<add namespace="Umbraco.Core.Models" />
<add namespace="Umbraco.Web.Mvc" />
<add namespace="umbraco" />
<add namespace="Examine" />
</namespaces>
As I was watching some of the surfaccontroller videos, I realized some of the other classes were also showing errors, so I decided to start a new project and try again. I came across some posts online saying mvc 5 is supported in umbraco 7.2, but only if you start with .net mvc 4 and then upgrade to mvc 5. On my new project, I started with an MVC 4 project. Then I installed umbraco and finally I updated to MVC 5 (via nuget). This resolved the issue.
Here is a link I found with some information that helped me: http://umbraco.com/follow-us/blog-archive/2015/2/19/umbraco-722-and-625-released
is working on a reply...