I would like to conditionally display the appropriate HTML for the client using this construct:
<input type="button" value="Foo" @(string.IsNullOrEmpty(Model.Identifier) ? string.Format("title={0} disabled=disabled", "Lorem ipsum") : "onclick=window.open('http://www.google.com'); return false;") />
This is the result I get:
<input type="button" value="Foo" title="Lorem ipsum" disabled=disabled />
I tried many constructs of Html.Raw (), but nothing helps. How to correctly display unencrypted HTML with quotes instead of html entities?
source share