I am a newbie. I actually have a similar question but relating to displaying an image in Partial View Macros. Do hope you get a response soon. Good Luck!
What version of umbraco are you using? Are you using a custom model in your partial view? You could use the MediaService which has a GetById method and return an IMedia object :)
how to use Library.MediaById in Partial View
Hi, very new to Umbraco and trying to do the following:
In my view I have this
and in the partial I am trying to do this:
but Visual Studio doesn't like Library, am I missing a namespace or something?
hi,
I am a newbie. I actually have a similar question but relating to displaying an image in Partial View Macros. Do hope you get a response soon. Good Luck!
what's about this one
You can find both MVC typed and dynamic Razor samples here
What version of umbraco are you using? Are you using a custom model in your partial view? You could use the MediaService which has a GetById method and return an IMedia object :)
Also to get the url you need a media object and from that object you need to the umbracoFile property
YourMediaObject.GetProperty("umbracoFile").ToString();
is working on a reply...