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 354 posts 1638 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.

Please Sign in or register to post replies

Write your reply to:

Draft