【发布时间】:2014-05-27 15:59:26
【问题描述】:
我从数据库中获取了一些编码的 html。在获取时我在某处解码了该 html。但粗体/斜体和其他格式未显示,仅显示文本。
我的代码
string a = da.GetLeftPanelData();//<-- in here Encoded html comes like <p style="text-align: justify;">
string b = WebUtility.HtmlDecode(a);
mypanel.InnerText = Regex.Replace(b, @"<[^>]+>| ", "").Trim();
【问题讨论】:
-
你的代码去掉了格式,你为什么希望它显示?
-
没有。我在这里只显示第一行代码。
-
一共有三行代码,第三行去掉了所有的格式。