Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeremy 14 posts 64 karma points
    May 01, 2015 @ 14:48
    Jeremy
    0

    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.

  • Mehul Gajjar 48 posts 172 karma points
    May 01, 2015 @ 15:20
    Mehul Gajjar
    0

    Hi Jeremy Bodager,

    instead of

    @{ Html.RenderPartial("umbHomepageBanner"); }
    

    you could just do

      @Html.Partial("umbHomepageBanner")
    

    Hope this is usefull

    Regards,

    Mehul Gajjar.

  • Jeremy 14 posts 64 karma points
    May 01, 2015 @ 15:23
    Jeremy
    0

    Same "error" message with:

    @{ Html.Partial("umbHomepageBanner"); }

    Except my partial doesn't get loaded now.

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    May 02, 2015 @ 21:33
    Marc Goodson
    1

    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.

  • Jeremy 14 posts 64 karma points
    May 04, 2015 @ 15:02
    Jeremy
    0

    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>

  • Jeremy 14 posts 64 karma points
    May 11, 2015 @ 18:51
    Jeremy
    100

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies