2016-10-10 4 views
0

description要素を持つxmlファイルがありますが、説明が長く、どのようにしてgridviewに書式設定されたテキストとして表示できますか?私は説明に<br/>タグを追加しようとしましたが、asp.netページはそれらを表示していません。Xml形式のデータをgridview asp.netに変換するC#

私は、ディスプレイへのコードの下に使用していた構造名FileItemsを持っており、その説明文字列では、私はこれまで、XMLからデータを保存し、.aspxの側では

FileItems.AppDescription = xmlNode.ChildNodes[i].InnerText; 

<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

はHtmlEncode BoundField中= "false" に設定し使用して、それを解決しました。 xmlファイルにも追加されています。それを解決する他の方法があるなら私は知っていると思いますが、私たちもhttputilityのhtmldecodeを使うことができると思います。

関連する問題