RazorEngine:不能用Html.Raw [英] RazorEngine: cannot use Html.Raw

查看:1429
本文介绍了RazorEngine:不能用Html.Raw的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RazorEngine外asp.net,当我尝试使用 @ Html.Raw(HTML字符串这里)写原始的HTML我遇到这个错误:

using RazorEngine outside asp.net I'm experiencing this error when I try to write raw html by using @Html.Raw("html string here"):

无法编译模板。 HTML这个名字并不在当前的背景下存在

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

你能帮助我吗?

谢谢!

推荐答案

该解决方案已经在这里找到:<一href=\"https://github.com/Antaris/RazorEngine/issues/34\">https://github.com/Antaris/RazorEngine/issues/34

The solution has been found here: https://github.com/Antaris/RazorEngine/issues/34

这足以使用 @(新RawString(HTML字符串这里)) @Raw(HTML字符串这里)而不是 @ Html.Raw(HTML字符串这里)

我希望这有助于!
再见

I hope this helps! Bye

这篇关于RazorEngine:不能用Html.Raw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆