Copied to clipboard

Flag this post as spam?

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

  • Sonja 132 posts 620 karma points
    Nov 15, 2018 @ 05:53

    Displaying image in Umbraco

    Hi I have image in a nested content and with


    I'm getting


    how do I put this value to get valid html, something that will display the image in

    <img src="~/images/12.jpg">


  • Dennis Adolfi 1072 posts 6378 karma points MVP 2x c-trib
    Nov 15, 2018 @ 06:33
    Dennis Adolfi

    Hi Sonja.

    Your property "myImg", what is the datatype? MediaPicker?

    In that case you could try:

    var media = myNestedContentItem.GetPropertyValue<IPublishedContent>("myImg");
    <img src='@media.Url'>

    Best of luck to you!

Please Sign in or register to post replies

Write your reply to: