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

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -