Your sample either isn't cpomplete, or you just didn't copy it all:
<% if(Eval("img_url") != ""){%>
some html goes here
<%} else {%>
some different html goes here
<%}%>
Notice the closing brace at the end.
I prefer to put logic in the code-behind in orer to keep the aspx file as clean as possible.
public string GetAppropriateHTML()
{
string html = "";
if (Eval("img_url") != "")
{
html = "some html goes here";
}
else
{
html = "some other html goes here"
}
return html;
}
Which reduces the clutter in the aspx file to this:
<%=GetAppropriateHTML() %>