How do I get the path og the images/files that I from Ids ?
@foreach (var item in galleryCollection) {
var imgArr = item.billeder.ToString().Split(new string[] { "," }, StringSplitOptions.None);
<p>@item.Name</p>
<p>@item.argang</p>
foreach(var imgId in imgArr){
<p> @imgId <br></p>
}
}
I have tried something like this – which I've been lucky with before:
var Img = Library.MediaById(imgId.Image);
var ImgPath = Umbraco.Media(imgId).Url;
But it gives me an error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Library' does not exist in the current context
Source Error:
Line 146: foreach(var imgId in imgArr){
Line 147:
Line 148: var Img = Library.MediaById(imgId.Image);
Line 149: var ImgPath = Umbraco.Media(imgId).Url;
Line 150:
Getting Image path from Image Id? [SOLVED]
How do I get the path og the images/files that I from Ids ?
I have tried something like this – which I've been lucky with before:
But it gives me an error:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0103: The name 'Library' does not exist in the current context
Source Error:
Solved it by playing around :-)
is working on a reply...