I'm trying to get a count of media files in a folder but .Count() isn't working.
var mediaFolder = Umbraco.TypedMedia(fontFolderId);
int mediaCount = mediaFolder.Children.Count();
The error I get is "'object' does not contain a definition for 'Count'"
The foreach loop works fine when I get each item in the folder but the .Count f**ks everything up.
.Count() not working on media
I'm trying to get a count of media files in a folder but .Count() isn't working.
The error I get is "'object' does not contain a definition for 'Count'" The foreach loop works fine when I get each item in the folder but the .Count f**ks everything up.
Can someone point out to me what I'm doing wrong?
Hi Gisli,
Do you inherit 'UmbracoViewPage' ?
Thanks
Maybe you need to add using statement to your view :
Dave
is working on a reply...