Copied to clipboard

Flag this post as spam?

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


  • roli81 7 posts 58 karma points
    Oct 20, 2023 @ 14:38
    roli81
    0

    Can't get content from an image field from a Icontent Object

    Hi folks

    I hav a strange behavior by getting a field value from a IContent object in UMbraco 12.2.0 When I call the Follow:

            IContent page =  _contentService.GetById(123);
            page.GetValue("images");
    

    I get the FQN of the content: "System.Collections.Generic.List`1[Umbraco.Cms.Core.Udi]" as string.

    So I think there is content in the field (I can see it also in the backoffice). But when I try this:

            IContent page =  _contentService.GetById(123);
            page.GetValue<IEnumerable<Umbraco.Cms.Core.Udi>>("images");
    

    I always get null.

    Any ideas?

    Greetings Roland

Please Sign in or register to post replies

Write your reply to:

Draft