In a SurfaceController you have access to the UmbracoHelper class via the 'Umbraco' property so the above could be:
var content = Umbraco.Content(1119);
if (content!=null){
string aa = content.Value<string>("CarRefName");
string bb = content.Value<string>("VehecleNo");
var image = content.Value<IPublishedContent>("ChooseFeatureImage");
var imageUrl = image!=null ? image.Url : "";
}
When you use the ContentService you are querying the database directly, using the UmbracoHelper you are querying the published Umbraco cache - which is much faster!
Get Media Url in surface controller
This is error.May I know how to get media url in surface controller.
Hi Aung
In a SurfaceController you have access to the UmbracoHelper class via the 'Umbraco' property so the above could be:
When you use the ContentService you are querying the database directly, using the UmbracoHelper you are querying the published Umbraco cache - which is much faster!
regards
Marc
How I use UmbracoHelper method.Please show me simple.
is working on a reply...