-
Notifications
You must be signed in to change notification settings - Fork 259
Encoding
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.
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"