-
Notifications
You must be signed in to change notification settings - Fork 579
6. Encoding Values
matthid edited this page Jan 20, 2015
·
4 revisions
This page is outdated! Please visit http://antaris.github.io/RazorEngine
By default RazorEngine is configured to encode as Html. This sometimes this presents problems were certain characters are encoded as Html but what you want is to output them as-is. To output something in raw format use the @Raw()
built-in method as shown in the following example:
string template = "@Raw(Model.Data)";
var model = new { Data = "My raw double quotes appears here \"hello!\"" };
string result = Razor.Parse(template, model);
Which should result in:
My raw double quotes appears here "hello!"