Copied to clipboard

Flag this post as spam?

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


  • Owen Hope 119 posts 140 karma points
    May 07, 2011 @ 01:41
    Owen Hope
    0

    Get Media URL -- problem .NET (not XSLT)

    Hi,

    Currently using Umbraco 4.0.2.1

    I am trying to get the Image URL of a Media node, but all I can ever return is the Media Node ID.

    I pass in the Media Node ID but I can never get the URL of that Node.

    I am using .NET for this user control so please help me with .NET solutions rather than XSLT.

    Thanks,

    Owen

     

     

  • Owen Hope 119 posts 140 karma points
    May 07, 2011 @ 01:55
    Owen Hope
    0

    Currently I am using this method:

    string videoThumbnailID = galleryVideo.GetProperty("videoMediumThumbnail").Value;
    int thumbID = int.Parse(videoThumbnailID);
    Media m = new Media(thumbID);
    string imageUrl = m.getProperty("umbracoFile").Value.ToString();

    But imageUrl is returning the ID of the Media Node, not the URL.

    Thanks,

    Owen

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 07, 2011 @ 11:56
    Jan Skovgaard
    0

    Hi Owen

    Try having a look at this post: http://our.umbraco.org/forum/developers/api-questions/5616-accessing-umbracolibraryGetMedia-in-a-user-control

    Does that do the trick fr you?

    /Jan

  • 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