css - Apply a colored box around my Status field -



css - Apply a colored box around my Status field -

i working on asp.net mvc web application uses bootstrap v2.0.4, , utilize next display value status field:-

@html.displayfor(model => model.assetstate.displaystate, new { @class= model.assetstate.displaystate.tostring() } )

then added next within css file:-

.operational { color:green; } .disposed { color:red; }

but above did not have effect on produced markup , displayed value homecoming default color ?

do next it'll work,

<span class="@model.assetstate.displaystate.tostring()"> @html.displayfor(model => model.assetstate.displaystate ) </span>

reference: adding css class razor @html.displayfor

how apply css @html.displayfor?

if want differently, not provided html helper, follow instruction link. can write own html helper.

http://www.codeproject.com/tips/720515/custom-html-helper-for-mvc-application

css asp.net-mvc twitter-bootstrap asp.net-mvc-4 razor

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -