Copied to clipboard

Flag this post as spam?

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


  • Lee Fear 7 posts 97 karma points
    Sep 24, 2019 @ 13:11
    Lee Fear
    0

    Render Image from Media

    I am trying to render an image that is in the Media Library. However using

    <img src="@Model.Value("carouselImage1")" />
    

    Does not work. How do I get the Url of the image?

  • Shaishav Karnani from digitallymedia.com 349 posts 1631 karma points
    Sep 24, 2019 @ 13:16
    Shaishav Karnani from digitallymedia.com
    100

    Hi Lee,

    Please try following:-

    @{
        var image = Model.Value<IPublishedContent>("carouselImage1");
        <img src="@image.Url" />
        }
    

    Hope this solves your issue.

    Cheers,

    Shaishav

  • Lee Fear 7 posts 97 karma points
    Sep 24, 2019 @ 13:25
    Lee Fear
    0

    Excellent, Thank you.

  • 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