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
Post a Comment