Copied to clipboard

Flag this post as spam?

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


  • André van der Plas 18 posts 108 karma points
    Jan 28, 2020 @ 08:58
    André van der Plas
    0

    Getting media url from uid

    Hi,

    I'm totally stuck. :-(

    We have a asp.net mvc website in which we would like to display data from Umbraco. The Umbraco installation is on a different web app. With SQL we query the Umbraco database. For media items the result is something like "umb://media/3d32d4c5a98549d89d7b7feb452fb0c3". Now we need to convert this to a proper url (which is also in the Umbraco database). But somehow we need to fugure out how to convert the UDI. How do I do this?? I've tried for half a day now but without any result. Which Umbraco dll's should I reference in my asp.net mvc project? In the previous versions of Umbraco we could just reference the media by ID. But not anymore...

    Greetings,

    André

  • Ryan Helmn 26 posts 188 karma points
    Feb 10, 2020 @ 14:59
    Ryan Helmn
    0

    If you use Umbraco.TypedContent() and pass the UDI into it, you can then do .Url. Umbraco parses the UDI to save you the headache of doing so yourself.

Please Sign in or register to post replies

Write your reply to:

Draft