加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – RazorEngine:不能使用Html.Raw

发布时间:2020-12-15 22:52:13 所属栏目:asp.Net 来源:网络整理
导读:在asp.net之外使用RazorEngine当我尝试使用@ Html.Raw(“html string here”)编写原始HTML时,遇到这个错误: Unable to compile template. The name ‘Html’ does not exist in the current context 你可以帮我吗? 谢谢! 解决方法 解决方案已经在这里找到
在asp.net之外使用RazorEngine当我尝试使用@ Html.Raw(“html string here”)编写原始HTML时,遇到这个错误:

Unable to compile template. The name ‘Html’ does not exist in the current context

你可以帮我吗?

谢谢!

解决方法

解决方案已经在这里找到: https://github.com/Antaris/RazorEngine/issues/34

只需使用@(new RawString(“html string here”))或@Raw(“html string here”)就可以使用@ Html.Raw(“html string here”).

我希望这有帮助!再见

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读