I’m using an SQL query to gather information from a database and C# + ASP to get it in a table on the front end side. I’m trying to make it so that when I get an item, it will check its value and change the font color it is displayed in based on the value. I’m not sure how the syntax is supposed to work with all the tags so I’m getting weird results. So far it looks like:
<td nowrap valign="top">
if (<%# DataBinder.Eval(Container, "DataItem.StreetNumber")%> == "1") {
<font color = "red"><%# DataBinder.Eval(Container, "DataItem.StreetNumber")%></font>
}
else
<%# DataBinder.Eval(Container, "DataItem.StreetNumber")%></td>
Hopefully that makes some sense.
A simpler way to do it may be something like this: