Copied to clipboard

Flag this post as spam?

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


  • Leon 101 posts 489 karma points
    Mar 12, 2015 @ 13:43
    Leon
    0

    display image from media picker in partial view macro parameter

    Hi.

    How do I display the image from a media picker used in a partial view parameter?

    This just gives the id.

    @Model.MacroParameters["image"]
    

    Leon

  • Leon 101 posts 489 karma points
    Mar 12, 2015 @ 14:13
    Leon
    101

    I found it - copied and altered from another post. Here is the code in my partial view macro.

    var imgId = Model.MacroParameters["image"];
    var mediaItem = Umbraco.TypedMedia(imgId);
    <img src="@mediaItem.GetPropertyValue("umbracoFile")" alt="@mediaItem.GetPropertyValue("Name")"/>
    
  • Nandakumar P 9 posts 88 karma points
    Aug 28, 2018 @ 09:40
    Nandakumar P
    0

    How to use Multiple Media Picker in Partial View

  • 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