Copied to clipboard

Flag this post as spam?

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

  • Meni 216 posts 390 karma points
    Sep 22, 2022 @ 22:33

    Image not display after change (Obsolete) Media Picker to Umbraco.MemberPicker2

    Hi, I changed the Media Picker data type from (Obsolete) Media Picker to Umbraco.MemberPicker2 and now images no longer display on my website.

    This is my code to display image:

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
        string w = (string)Umbraco.Media(CurrentPage.articleImg).umbracoWidth;  
        string h = (string)Umbraco.Media(CurrentPage.articleImg).umbracoHeight;
        int imgWidth = w.AsInt();
        if (imgWidth > 1500) {
            <div class="col-xl-12" class="news-page-img-container">
                <img src="@Umbraco.Media(CurrentPage.articleImg).Url" alt="@CurrentPage.photoAlt" class="news-img" />
        else {
                <div class="col-xl-2 col-lg-2 col-md-2">
                <div class="col-xl-8 col-lg-8 col-md-8">
                    <img src="@Umbraco.Media(CurrentPage.articleImg).Url" alt="@CurrentPage.photoAlt" class="img-fluid" />
                <div class="col-xl-2 col-lg-2 col-md-2">

    Any idea why images no longer display? (even after pick them again)


  • Meni 216 posts 390 karma points
    Sep 23, 2022 @ 05:41

    Ok, I figured out and resolved the issue. I only had to add to each @Umbraco.Media .ToString()


    I guess is because the new media picker 2 uses udi which is string and not int ?

    Anyway it works for me

    Thanks also for this answer:

Please Sign in or register to post replies

Write your reply to: