How do I output raw html when using RazorEngine (NOT from MVC)

前端 未结 6 1715
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 04:34

I am trying to generate emails with HTML content. this content has already gone through sanitation so I am not worried in that regard, however when I call:

         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 04:39

    I found all of these worked with me.

    @{var myHtmlString = new HtmlString(res);}
    @myHtmlString
    
    
      @MvcHtmlString.Create(res)
    
      @Html.Raw(res)
    

提交回复
热议问题