asp.net mvc - Can I write an inline if with HTML content? -


i want write like:

@( checkcondition ? "<span class='label'>right!</span>" : "") 

but showing source code instead html, there easy way this?

thank you!

you can use @html.raw(mystring) method this:

@( checkcondition ? html.raw("<span class='label'>right!</span>") : html.raw("")) 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -