C# Html.Raw 不工作 asp.net mvc

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9556008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 07:52:11  来源:igfitidea点击:

Html.Raw is not working asp.net mvc

c#asp.net-mvcvisual-studio-2010razor

提问by Parminder

I have some html stored in a table. here is some sample data

我有一些 html 存储在一个表中。这是一些示例数据

<p><span style="font-size: small; color: #ff0000;"><span style="font-size: small;"> <span style="font-size: large; color: #000000;">???</span><br />  <br />????? ????? ?? ??? ??? ?? ??? ???? ????,<br />?? ???? ?? ???? ??? ?? ?? ???? ?? ???,<br />

I am trying to display on page, I am using asp.net mvc razor view and using

我正在尝试在页面上显示,我正在使用 asp.net mvc razor 视图并使用

@Html.Raw(blog.Body)

but its not working. can someone help, what is the reason.

但它不工作。有人可以帮忙,是什么原因。

Thanks

谢谢

Parminder

帕明德

采纳答案by Mohammed Swillam

kindly try this:

请试试这个:

@Html.Raw(HttpUtility.HtmlDecode(blog.Body));

and let me know if it worked.

让我知道它是否有效。