Copied to clipboard

Flag this post as spam?

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


  • Manasa 41 posts 161 karma points
    Oct 07, 2016 @ 15:55
    Manasa
    0

    The call is ambiguous between the following methods or properties,How to resolve?

    I am getting the following error while i am setting up the background image for my website banner.

    The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.Media(System.Collections.Generic.IEnumerable

    enter image description here

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Oct 07, 2016 @ 16:55
    Dennis Aaen
    100

    Hi Chinny and welcome to our :)

    Try to use this snippet of code, then you should see a background image on your div.

    @{
        if(home.HasValue("backgroundImage")){
            var mediaItem = Umbraco.TypedMedia(home.GetPropertyValue("backgroundImage")); 
            <div class="container-fluid logodiv radial-center" style="width:100%; height:100%;">test</div>
    
            <style>
                        .logodiv{
                             background:url(@mediaItem.GetPropertyValue("umbracoFile")) no-repeat;
                        }
                </style>    
        }   
    }
    

    Be aware that the div is only shows when you have picked a picture in the media picker. Is what the the .HasValue does, only show the markup when there is a picture picked in the picker.

    Hope this helps,

    /Dennis

  • Manasa 41 posts 161 karma points
    Oct 12, 2016 @ 16:15
    Manasa
    0

    Thank you Dennis :)

  • 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