Copied to clipboard

Flag this post as spam?

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


  • Dibs 183 posts 899 karma points
    Jul 03, 2015 @ 12:10
    Dibs
    0

    The call is ambiguous between the following methods or properties: error

    Dear Umbraco Forum Team

    I get the following error when adding tag <img class="center-block" src="@Umbraco.Media(itm.image).Url"> to a partial view: The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.Media(params int[])' and 'Umbraco.Web.UmbracoHelper.Media(params string[])'

    I already have another partial view using the same code, and renders child page items as normal.

    Thanks Dibs

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Jul 03, 2015 @ 13:50
    Ismail Mayat
    0

    Dibs,

    Where is itm.image coming can you show that code also what type of property is image?

    Regards

    Ismail

  • Dibs 183 posts 899 karma points
    Jul 03, 2015 @ 14:05
    Dibs
    0

    Hi Ismail

    here is my code @{ var source = CurrentPage.Children("psPage").Where("Visible"); }

    @if (source.Any()) { @foreach (var itm in source) {
    <a href="@itm.Url" title="@itm.Name"><img src="@Umbraco.Media(itm.image).Url"><br/>@itm.Name

    }

    It is from a child page under a parent page and is of media picker type

    Thanks Dibs

  • 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