Use .cshtml pages in Composite C1 that are not strict XHTML
2 answers
Wrap bad / unsafe markup in a CDATA section. Since the strict XML requirement is primarily needed within the Composite C1 rendering engine and is generally not browser specific, Composite C1 treats CDATA sections as "messy markup" that it won't parse, but just emits raw:
<div>
<![CDATA[
Bad & ugly HTML!<br>
]]>
</div>
It will pass through Composite C1 unhindered and exit as:
<div>
Bad & ugly HTML!<br>
</div>
The above is from http://docs.composite.net/Layout/Writing-XHTML
Here's a simple example with Razor syntax:
<div>
<![CDATA[
@{
string unstructuredMarkup = "Bad & ugly HTML!<br>";
@Html.Raw(unstructuredMarkup);
}
]]>
</div>
+2
source to share