Reputation: 13
I'm trying to display code samples to my webpage and the razor view engine is treating the tags as code.
Example:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
does not appear on the page.
How do I stop this functionality?
Upvotes: 1
Views: 686
Reputation: 1082
Html.Encode and Html.Raw should do the trick with XML...
@Html.Encode(Html.Raw("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>"))
ETA: Had that a bit wrong.
Upvotes: 1