Reputation: 1882
I'm running Postal from a service. My @Message has html. @Html.Raw is not available. When Postal runs my templated view, I get HtmlEncoded html. does anyone know how to fix this?
Upvotes: 6
Views: 1584
Reputation: 1141
You can use:
@(new System.Web.HtmlString(StringToBeEncoded))
which is basically the same as does HtmlHelper.Raw(StringToBeEncoded)
method under the hood. Moreover, you will not get any error in Visual Studio for the templates.
Upvotes: 1
Reputation: 213
In our service, we've used:
@Raw(StringToBeEncoded)
In the html template it will complain it can not be resolved, but at runtime @Raw works fine. Its part of RazorEngine.
Upvotes: 5