小编Web*_*ing的帖子

HTML解码和编码

我试图解码我在MVC 3 Razor应用程序中的数据库中的html文本.数据库中的html文本未编码.我尝试httpUtility.decode,server.decode,但没有一个工作.最后我设法使它成功Html.raw(string)

非工作代码的样本

@Server.HtmlDecode(item.ShortDescription)
@HttpUtility.HtmlDecode(item.ShortDescription)
Run Code Online (Sandbox Code Playgroud)

你知道为什么我不能在我的情况下使用html.decode!

我认为这样可以节省一些人从寻找几个小时.

html c# encode decode asp.net-mvc-3

2
推荐指数
1
解决办法
9187
查看次数

标签 统计

asp.net-mvc-3 ×1

c# ×1

decode ×1

encode ×1

html ×1