I have a template field in a gridview with a label whose text I want to alter depending on an if statement. The Following of course does not work but this is what i want to accomplish.
<%if Eval("Address") != ""%>
<%{ %>
<ItemTemplate>
<asp:Label ID="Label18" nowrap="nowrap" runat="server" Text='<%# Eval("Address") + "<br>" + Eval("City") + "," + Eval("State") + " " + Eval("Zip1") + " " + Eval("Zip2") %>'></asp:Label>
</ItemTemplate>
<%} %>
How can I achieve this?