HTML is being rendered as literal string using RazorEngine. How can I prevent this?

前端 未结 2 1066
心在旅途
心在旅途 2020-12-21 00:44

I\'m trying to generate a HTML document with RazorEngine (http://razorengine.codeplex.com/). Everything is mostly working, but the problem I have now is some of the

相关标签:
2条回答
  • 2020-12-21 00:53

    Have you tried:

    @Raw(installationReport.DigiChannels())
    

    Edit : I could use it in following way (MVC3)

    @Html.Raw(installationReport.DigiChannels())
    
    0 讨论(0)
  • 2020-12-21 00:56

    The alternative to @Raw is to change your API to return HtmlStrings in appropriate places

    Represents an HTML-encoded string that should not be encoded again.

    The default razor behaviour is to encode strings.

    0 讨论(0)
提交回复
热议问题