What I have is an asp repeater which brings through information for events that are created on the admin section of the web page.
These events are allowed to have images added onto them, I am able to bring the image through correctly, but what I am attempting to do is to bring through a generic image if no image is available.
What I have just now is:
<img id="eventlogoholder" visible="<%#If(Eval("event_logo").ToString > "", "True", "False")%>", title= "<%# Eval("event_title").ToString%>" alt="" src="<%# Replace(Eval("event_logo").ToString, Application("IMAGEFOLDER"), Application("IMAGETHUMBNAILS"))%>" />
There is, on of them, solution based on comments:
Else replace it with
, (period) ...
If(condition, do if true, do if false)
src='<%#If(Eval("event_logo").ToString.Trim <> "", Replace(Eval("event_logo").ToString, Application("IMAGEFOLDER"), Application("IMAGETHUMBNAILS")) , "/Images/Thumbnailimages/posters/Noimage.jpg")%>'
since You use eval You have to put all code inside
You have to use
>, you dealing with string, not numbers.
Eval("event_logo").ToString.Trim ... there can be empty, space char and condition will be True
Of course, now You can remove complete code block for