Dot Net Sample Codings
Tuesday, July 19, 2016
How to add multiple css values into Style in MVC
@{
string
color =
"black"
;
if
(Model[i].RevenueRecovered.HasValue && Model[i].RevenueRecovered.Value < 0)
{
color =
"red"
;
}
}
new
{ @style =
string
.Format(
"width:100%; color:{0}"
, @color) }
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)