Copied to clipboard

Flag this post as spam?

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


  • Marc-André 63 posts 279 karma points
    May 02, 2019 @ 20:44
    Marc-André
    0

    Using dictionary in @model IPublishedContent

    Hello!

    I try to use the dictionary in my partial view but I'm missing the namespace I think. I got the error "The type or namespace name 'GetDictionaryValue' does not exist in the namespace 'Umbraco' "

    Here's my code :

    @model IPublishedContent
    @using Umbraco.Web.UI
    <div class="blogCategory"><span>@Model.name</span>@Umbraco.GetDictionaryValue("test")</div>
    

    Thanks in advance!

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    May 02, 2019 @ 20:52
    Alex Skrypnyk
    100

    Hello

    Use this code:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage
    @using Umbraco.Web.UI
    <div class="blogCategory"><span>@Model.name</span>@Umbraco.GetDictionaryValue("test")</div>
    
  • Marc-André 63 posts 279 karma points
    May 02, 2019 @ 20:56
    Marc-André
    0

    Thanks! :')

Please Sign in or register to post replies

Write your reply to:

Draft