Latest web development tutorials

ASP.NET XML DocumentSource property

XML control XML control

Definition and Usage

DocumentSource property is used to set or return path in the Xml control to display XML documents.

grammar

<asp:Xml DocumentSource="path" runat="server" />

属性 描述
path 字符串值,规定 XML 文件的位置。

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

  • 相对路径:文件相对于当前页面位置的路径(比如 "~/note.xml")
  • 绝对路径:绝对路径(比如 "C:xmlnote.xml")


Examples

Examples

The following example sets the XML document Xml control to use:

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

The demonstration >>

XML file used in this example is " note.xml ."


XML control XML control