我有带描述元素的xml文件,描述很长,如何在gridview中将它们显示为格式化文本。我尝试在说明中添加<br/>
标签,但asp.net页面没有显示它们。
我有一个结构名称FileItems并在该描述字符串中,所以我将数据从xml保存到此,
FileItems.AppDescription = xmlNode.ChildNodes[i].InnerText;
在.aspx方面,我使用下面的代码显示:
<asp:BoundField DataField="AppDescription" HeaderText="AppDescription"
SortExpression="AppDescription">
<ItemStyle Width="55%"></ItemStyle>
</asp:BoundField>
xml文件中的示例文本
<description>
1. Lorem Ipsum is simply dummy text of the printing and typesetting industry.
2. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
3. When an unknown printer took a galley of type and scrambled it to make a type specimen book.
4. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</description>
答案 0 :(得分:0)
使用设置HtmlEncode =&#34; false&#34;解决它在BoundField中。也添加在xml文件中。如果还有其他方法可以解决它,那么我想知道,我想我们也可以使用httputility的htmldecode。