How to set a color of an Html.DisplayFor?

0

In my application I have this Html Helpers :

@Html.DropDownList("estado", new List<SelectListItem>{
    new SelectListItem {Text="Pago", Value="Pago"},
    new SelectListItem {Text="Pendente", Value="Pendente"}
    }, "Selecione o Estado:", new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.estado, "", new { @class = "text-danger" })

And here is where I display the selected item, that is, if you chose Paid or Paid :

<td>
    @Html.DisplayFor(modelItem => item.estado)
</td>

So I would like to have Paid it written in Green if Pending is displayed in red , how to solve this problem?

    
asked by anonymous 02.03.2018 / 23:00

0 answers