Hi,
Which version/hotfix of Kentico
CMS you are using? I have tried following code with 5.5 version and it works fine - it means - if the field is empty "no image" is displayed, otherwise, the image is displayed.
<%# IfEmpty(Eval("ItemText"), "no image", "<img src=\"" + Eval("ImagePath") + "\" />") %>
I do not know the type of your field used for storing the image. But if the GUID of this image is stored in the column you could use following code to generate complete code:
<%# GetImage("NewsTeaser") %> -Inserts a complete HTML code of the image stored in the column of the given name.
In this case your transformation code should look like:
<%# IfEmpty(Eval("ItemText"), "no image", GetImage("NewsTeaser")) %>
Best regards,
Ivana Tomanickova