在文本框中显示格式化的xml [英] show formatted xml in textbox
问题描述
我一直在寻找一种在文本框中显示格式化的xml的方法,到目前为止,我发现的所有内容都指向从文件中读取xml并对其进行格式化,但是我想显示保存在数据库中的xml字段.
I've been searching for a way to show formatted xml in a textbox, everything I've found so far points towards reading in xml from a file and formatting that, however I want to show xml which is held in a database field.
这个想法是,用户将有记录返回到gridview,由于其大小,gridview将显示除xml消息以外的所有内容.然后,他们可以选择记录,并在弹出表单上显示xml.
The idea is that a user will have records returned to a gridview, the gridview will show everything apart from the xml message due to its size. They can then select the record and show the xml on a pop-up form.
我已经将xml传递给了弹出表单,只是不确定如何处理它.任何想法都欢迎.
I have the xml passed to the pop-up form, just not sure how to handle it. Any ideas welcome.
推荐答案
使用
xmlOut = System.Xml.Linq.XDocument.Parse(txtXml).ToString();
这篇关于在文本框中显示格式化的xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!