.NET:如何显示字符串作为格式的HTML? [英] .NET: How to display string as a formatted HTML?

查看:209
本文介绍了.NET:如何显示字符串作为格式的HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的数据库写成一个串一个HTML标记。如何转换和查看作为格式化的HTML标记?我试图Server.HtmlEn code(),HttpUtility.HtmlEn code(),但没有成功。

I have in my DB a HTML markup written as a strings. How to convert them and view as a formatted HTML markup ? I tried Server.HtmlEncode(), HttpUtility.HtmlEncode() with no success

推荐答案

这是不是像你所追求的:<一href="http://dotnetslackers.com/articles/aspnet/en$c$c_and_display_html_securely_in_asp_net_2_0.aspx"相对=nofollow>恩code和显示HTML - DotNetSlackers

Is this something like what you are after: Encode and Display HTML - DotNetSlackers

这篇关于.NET:如何显示字符串作为格式的HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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