I have a problem regarding multiple image cropper, at first I've replaced the default File upload property with an Image cropper property on my Image media type. And I'm using multiple media picker to upload more than one images, my problem is how to get the image URL in the surface controller?
This is what I have done
var docsId = Umbraco.TypedContent(Convert.ToInt32(document.Get("id")));
var imageList = docsId.GetPropertyValue<string>("images").GetCropUrl(width: 329, height: 200);
but it says 'Cannnot implicitly convert type 'string' to 'System.Collections.Generic.List'
I tried another option, and I tried this code
var docsId = Umbraco.TypedContent(Convert.ToInt32(document.Get("id")));
var imageList = docsId.GetPropertyValue<string>("images").GetCropUrl(width: 329, height: 200);
its error again 'An exception of type 'System.ArgumentNullException' occurred in umbraco.dll but was not handled in user code'
Hope anyone can help with this problem. I'm new in Umbraco.
Thank you,
Jin
document
?IPublishedContent
? – harvzordocument
is just the asGetPropertyValue
. – Jin