Copied to clipboard

Flag this post as spam?

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


  • Lewis Smith 208 posts 617 karma points c-trib
    Mar 30, 2019 @ 19:28
    Lewis Smith
    0

    The type or namespace name 'RenderModel' could not be found (are you missing a using directive or reference?)

    Hi all,

    I'm using Umbraco 8.0.1 and im trying to do the normal MVC pattern i usually do on version 7...

    I have a controller (see below) and im when trying to add the directive like i normally do (hover over and add it) its not finding anything for RenderModel...

    Any ideas where im going wrong?

    using System;
    using System.Web.Mvc;
    using Umbraco.Core.Logging;
    using Umbraco.Core.Models.PublishedContent;
    using Umbraco.Web.Models;
    using Umbraco.Web.Mvc;
    
    namespace umbraco8.Controllers
    {
        public class HomeController : RenderMvcController
        {
            public override ActionResult Index(RenderModel model)
            {
                return base.Index(model);
            }
        }
    }
    

    Any pointers would be great!

    Lewis

  • Lewis Smith 208 posts 617 karma points c-trib
    Mar 30, 2019 @ 19:32
    Lewis Smith
    0

    I'm pretty sure i need to reference umbraco.dll or i think that was the case in version 7, but not overall sure here!

    I have the following Umbraco references in my project:

    Umbraco.Core
    Umbraco.Examine
    Umbraco.ModelsBuider
    Umbraco.Web
    Umbraco.Web.PublishedContentModels (im using model builder dll mode to a custom project)
    Umbraco.Web.UI
    
  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Mar 30, 2019 @ 20:18
    Marc Goodson
    103

    RenderModel has been replaced by ContentModel in V8

    Try that instead

    The rest is same as V7

    Regards

    Marc

  • Lewis Smith 208 posts 617 karma points c-trib
    Mar 31, 2019 @ 13:33
    Lewis Smith
    0

    Thanks Marc! Worked a treat!

  • Ebin 9 posts 78 karma points
    Feb 05, 2020 @ 12:00
    Ebin
    0

    Thanks Marc . Great !!

Please Sign in or register to post replies

Write your reply to:

Draft