Try our conversational search powered by Generative AI!

Getting URL of an imageFile


I have been struck at a point to get the URL for an image file, so as to hyperLink the file dynamically.

I was trying  UrlResolver.Current.GetUrl(imageFile.ContentLink) . 

imageFile.ContentLink has valid reference, but while tryig to get the URL for this reference throws a null pointer exception. 

                     System.NullReferenceException: Object reference not set to an instance of an object.

I am working with EpiServer

Mar 02, 2016 12:13

Can't see anything wrong there. Double check that imageFile isn't null and same for UrlResolver object...

Mar 02, 2016 12:20
* 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.