How to Check Image Empty for Teasure Image in Document Type control as File in Kentico 8.0

Moiz Mala asked on September 11, 2014 11:51

We are using Kentico 8.0.19 for a application.

I have Teaser Image defined in one of the document types as “File” field type with “Document uploader” as control.

I have created to separate pages for same document type. One in which Teaser image is not uploaded and other it is upload.

I have set the following transformation, however it returns “no” in the span for both of the records.

<%# IfEmpty(Eval("GalleryTeaserImage"),"yes","no") %>

Can you please guide what I need to take care further?

Recent Answers

Moiz Mala answered on September 11, 2014 11:53

I have got findings as below and it works fine:

<%# IfEmpty(CMS.Helpers.ValidationHelper.GetString(Eval("GalleryTeaserImage"),string.Empty).Replace(Guid.Empty.ToString(),string.Empty).Trim(),"<img src=\"~/App_Themes/CorporateSite/Images/no_image_gallery.png\" alt=\"Default album image\" />", GetImage("GalleryTeaserImage", 230, 230, 500, Eval("DocumentName"))) %>

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.