Try our conversational search powered by Generative AI!



I'd like to fetch all images belonging to a page from code. Is that feasible in Episerver 7.5 via the blobfactory?

Mar 11, 2014 14:04

What about following code?

var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
var helper = ServiceLocator.Current.GetInstance<ContentAssetHelper>();
var folder = helper.GetAssetFolder(CurrentPage.ContentLink);
var images = contentRepository.GetChildren<MediaData>(folder.ContentLink);


Mar 11, 2014 20:27

That probably works. I ended up with the following lines of code:



var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();

var contentAssetFolder = contentRepository.Get<ContentAssetFolder>(page.ContentAssetsID);

images = contentRepository.GetChildren<


Mar 14, 2014 8:56

Pardon for the unformatted code. How do I go about pasting the code with its original formatting?



Mar 14, 2014 8:57

You shoud insert code block (1st icon in toolbar).

Mar 14, 2014 9:13
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.