the code from the website does not take folders into account so this will not work for me. My knowledge of xpAthIterator in C# is not very good so i need some help here.
I can get the correct folder and XML like this
XPathNodeIterator media = umbraco.library.GetMedia(mediaFolderID,true);
Which outputs as ( media.Current.OuterXML.ToString()):
Hi, I found something. I'm still not sure if this is correct because it still takes a long time in the loop (varying from 10-40ms depending on number of images in folder) when I include this code.
Using umbraco.library.getmedia in C# instead of GetMedia
Hi,
I have C# code that uses code below to get an image from a media folder.
This code however is too slow. So I need a better solution. I use umbraco.library.getMedia in XLST and that works great, also I read this post http://shazwazza.com/post/Ultra-fast-media-performance-in-Umbraco which says that getmedia works faster.
the code from the website does not take folders into account so this will not work for me. My knowledge of xpAthIterator in C# is not very good so i need some help here.
I can get the correct folder and XML like this
Which outputs as ( media.Current.OuterXML.ToString()):
From this XML I need the umbracoFile value of the first image. I cannot seem to get this working.
Hope somebody can help me with this thanks!
Hi, I found something. I'm still not sure if this is correct because it still takes a long time in the loop (varying from 10-40ms depending on number of images in folder) when I include this code.
is working on a reply...