ASP.NET XML DocumentSource 属性

定义和用法
DocumentSource 属性用于设置或返回在 Xml 控件中显示的 XML 文档的路径。
语法
<asp:Xml DocumentSource="path" runat="server" />
属性 | 描述 |
---|---|
path | 字符串值,规定 XML 文件的位置。
该属性可以是相对或绝对路径:
|
实例
实例
下面的实例设置了 Xml 控件要使用的 XML 文档:
<form runat="server">
<asp:Xml id="xml1" runat="server" DocumentSource="note.xml" />
</form>
<asp:Xml id="xml1" runat="server" DocumentSource="note.xml" />
</form>
演示实例 »
在本实例中使用的 XML 文件是 "note.xml"。
