【发布时间】:2016-10-10 12:59:54
【问题描述】:
我有带有描述元素的 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>
【问题讨论】: