Copied to clipboard

Flag this post as spam?

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


  • AmandaEly 123 posts 379 karma points
    Jul 15, 2015 @ 15:47
    AmandaEly
    0

    Ambiguous call error when fetching an image url in the server

    Hi, This small piece of code works fine on my own machine in debug mode but crashes on the server:

    var defaultIconId = CurrentPage.GetPropertyValue("defaultIcon"); var defaultIconObject = Umbraco.Media(defaultIconId);

    The second line gives the following error:

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

    Any clues? I may try setting the fetched "defaultIconId" to string but would like to know what is the approved way.

  • AmandaEly 123 posts 379 karma points
    Jul 15, 2015 @ 16:01
    AmandaEly
    0

    Changing the top line to

    var defaultIconId = CurrentPage.GetPropertyValue

    did not help either. Still works fine on the local machine

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jul 15, 2015 @ 16:21
    Ismail Mayat
    0

    Try

    var defaultIconId = CurrentPage.GetPropertyValue<string>("defaultIcon");
    
  • AmandaEly 123 posts 379 karma points
    Jul 15, 2015 @ 16:25
    AmandaEly
    100

    Sorry, I did try that. It didn't work. Then I tried ToString(). I think that did work but I have another issue with the database not refreshing and being unable to access the back office, so there was a null value.

    So I think I'll close the thread for now.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft