Copied to clipboard

Flag this post as spam?

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


  • Keith Jackson 183 posts 552 karma points
    Jan 07, 2013 @ 16:57
    Keith Jackson
    0

    Umbraco 4.11 MVC Error

    I am porting a U5 site to 4.11 and am having some problems getting the Model object working.

    'Umbraco.Web.Models.RenderModel' does not contain a definition for 'PrimaryHeader' and no extension method 'PrimaryHeader' accepting a first argument of type 'Umbraco.Web.Models.RenderModel' could be found

    I have the following, but I get the error above from the Model...

    }
    @section PageTitle
    {
        @Model.PrimaryHeader
    }
    <section id="primary">
        @Umbraco.Field("bodyText", insertBefore: "&lt;p&gt;", insertAfter: "&lt;/p&gt;", convertLineBreaks: true, removeParagraphTags: true)
        <div id="logoLinkArea">

  • Keith Jackson 183 posts 552 karma points
    Jan 07, 2013 @ 18:12
    Keith Jackson
    0

    I've managed to get this working using...

    @Model.Content.GetProperty("PrimaryHeader").Value

     

    Is there a better way than this? This seems very longwinded

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 07, 2013 @ 20:31
    Dirk De Grave
    1

    According to the docs, you should be able to use @CurrentPage when using dynamics. See here.

     

    Cheers,

    /Dirk

  • Keith Jackson 183 posts 552 karma points
    Jan 10, 2013 @ 00:19
    Keith Jackson
    0

    Thanks Dirk - These docs should help me a lot.

Please Sign in or register to post replies

Write your reply to:

Draft