I would like to add If statement contains, and greater or equal, or less then with the background colors and font-color for the radioband in C#
I have radioband contains
400 : background color = light green and font color= black
433 to 499 : background color = dark green and font color= white
800, 801…to 899 : background color = yellow and font color= black
900 : background color = light blue and font color= black
901 to 939 : background color = brown and font color= white
940, 941… to 990 : background color = red and font color= white
ASP.NET MVC:
<div class="col-7 dffdc" style="align-items: flex-start; justify-content: space-evenly; height: inherit;">
<div class=" noPad">
<div class="glance-text">
<div title="<%=item.SensorName%> - <%=item.RadioBand %>" class="glance-name" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 215px;">
<%= item.SensorName%><br /><%:item.RadioBand %>
</div>
</div>
</div>
C#
public void SetRadioBand ()
{
if (RadioBand.Contains("900"))
{
Should be backgroundcolor: light blue and fontcolor: black
}
else if (RadioBand.Contains("868"))
{
Should be backgroundcolor: yellow and fontcolor: black
}
else if (RadioBand.Contains("800"))
{
Should be backgroundcolor: yellow and fontcolor: black
}
else if (RadioBand.Contains("400"))
{
Should be backgroundcolor: yellow and fontcolor:black
}
else if (RadioBand.Contains("433"))
{
Should be backgroundcolor: teal and font color black
}
else if (RadioBand.Contains("920))
{
Should be backgroundcolor yellow and font color black
}
else if (RadioBand is greater or equal 901 and less than 939
{
Should be backgroundcolor yellow and font color black
}
else if (RadioBand is greater than 433 and less than 499
{
Should be background purple and font color white
}
}
Your help is much appreciated. Thanks.