ASP.NET DocumentSource 属性

返回 ASP.NET XML 控件参考手册

定义和用法

DocumentSource 属性用于设置或返回在 Xml 控件中显示的 XML 文档的路径。

语法

<asp:Xml DocumentSource="path" runat="server" />
属性 描述
path

字符串值,规定 XML 文件的位置。

该属性可以是相对或绝对路径:

  • 相对路径:文件路径相对于当前页面(比如:"~/note.xml")
  • 绝对路径:比如:"C:\xml\note.xml"
这个在线速查手册由www.w▌▬▌▬3▌▬x▌▬▌▬u▌▬e.com提供,请勿盗用!

实例

下面的例子设置了 Xml 控件的 DocumentSource:

<form runat="server">
<asp:Xml id="xml1" runat="server" DocumentSource="note.xml" />
</form>

在例子中以及 TIY 中使用的 XML 文件是 "note.xml"。

返回 ASP.NET XML 控件参考手册