Hi we've moved from 4 to 6 and looking at the documentation for 6 it's not that clear what the best way of simply retrieving some media via the api in your codebehind??
I found one reference in a blog post but it's not in the documentation and i don't know if it's right:
You're right that you want to use MediaService. How you access it might depend on where you're writing the code - is it for a usercontrol? If so you should adjust your usercontrol to inherit from UmbracoUserControl - then you'll automatically have access to MediaService by just: Services.MediaService
In other areas you should be able to use the ApplicationContext - what troubles are you having with that?
Umbraco v6 Media?
Hi we've moved from 4 to 6 and looking at the documentation for 6 it's not that clear what the best way of simply retrieving some media via the api in your codebehind??
I found one reference in a blog post but it's not in the documentation and i don't know if it's right:
ApplicationContext.Current.Services.MediaService
this article doesn't mention it anywhere:
http://our.umbraco.org/documentation/Reference/Management-v6/Services/MediaService
is there a good getting started with ApplicationContext etc.. the documentation doesn't provide any real examples..
Hi Tom,
You're right that you want to use MediaService. How you access it might depend on where you're writing the code - is it for a usercontrol? If so you should adjust your usercontrol to inherit from UmbracoUserControl - then you'll automatically have access to MediaService by just: Services.MediaService
In other areas you should be able to use the ApplicationContext - what troubles are you having with that?
Hope this helps,
Tom
Hi Tom,
Cheers! just wanted clarification.. because it wasn't documented anywhere other than that blog post..
is working on a reply...