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, ie if it was chosen Paid or Pending:
<td>
@Html.DisplayFor(modelItem => item.estado)
</td>
So I’d like you to be chosen Paid it was written in green, case Pending that is displayed on red color, how to solve this problem?
Not just a Javascript? type after choosing change this item to the desired colors?
– novic
A certain Virgilio, but give me an example of this in practice, because I tried in many ways and did not give!!
– WPfan