Skip to content
Ivan Balan edited this page Aug 12, 2016 · 1 revision

By the default RazorLight encodes Model values as HTML, but sometimes you want to output them as is.

Example

string content = "Hello @Model.Name";
var model = new
{
    Name = "\"John Doe\""
};

string result = engine.ParseString(content, model);

//Output - Hello "Jogn Doe"

Use @Raw() method to output value without encoding it

string content = "Hello @Raw(Model.Name)";

//Output - Hello "John Doe"
Clone this wiki locally