I have three different situations to apply color to div based on if conditions. the single ones (first and third) are working properly the middle one is not. Values exists, already checked. What am I doing wrong?
- @if (item.RiskLevelF < Model.GreenHL)
- {
- class="col-md-3">
- class="form-control" style="background-color:limegreen">@Html.DisplayFor(model => item.RiskLevelF)
- }
- @if ((item.RiskLevelF > Model.GreenHL) && (item.RiskLevelF < Model.YellowHL))
- {
- class="col-md-3">
- class="form-control" style="background-color:yellow">@Html.DisplayFor(model => item.RiskLevelF)
- }
- @if (item.RiskLevelF > Model.YellowHL)
- {
- class="col-md-3">
- class="form-control text-white" style="background-color:red">@Html.DisplayFor(model => item.RiskLevelF)
- }


Marius VasilePosted May 9, 2021, 2:57 PM
Rijwan AnsariPosted May 9, 2021, 10:45 AM
Marius VasilePosted May 8, 2021, 10:20 AM
Marius VasilePosted May 8, 2021, 9:32 AM
Sachin SinghPosted May 8, 2021, 9:29 AM