I have some tabular data, when the label has some specific value I need to make it show off.
Trying to do by styling the TD.
My C# sets the value for Label1.text
Can you think of any other way for doing so? It’s throwing ambiguity error.
<% if (Label1.Text == "1") { %>
<td style="background:#ffedad; border:#e3a345; color:#cd5c0a"><asp:Label ID="Label1" runat="server" /></td>
<% } else {%>
<td><asp:Label ID="Label1" runat="server" /></td>
<% } %>
EDIT
Did something else (and cleaner).
Worked on some code behind variables along with some new td.alt on my css file to get the value of the label. If it’s 1, then I set a
classLabel variable to alt and then I just set the class inside the td
<td class="<%classLabel%>"><asp:Label ID="Label1" runat="server" /></td>
Still, I’m getting and error on this last line in my aspx page, any ideas where the error is?
You can try this with a single line :
Setting the style code behind and with a css class would be cleaner IMHO
Hope this will help