I wish to output a Button on to the screen if there is anything returned from the database. The following is what I want to achieve:
<%# IfEmpty(Eval("Link1URL"), "", "<a href="<%#Eval("Link1URL")%>" class="btn"> <%#Eval("Link1Title")%> </a>")) %>
What I am trying to say here is, If the field Link1Url is empty, then display nothing. Otherwise, display an <a> tag with the Link1URL field as the href.
This doesn't work as the inner macro: <a href="<%#Eval("Link1URL")%> messes things up for the outer IfEmpty macro.
How can I fix this issue?