ASP.NET XML DocumentSourceProperty


XML 控件XML Control

Definition and Usage

The DocumentSource property is used to set or return the path of the XML document displayed in the Xml control.

Syntax

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

Property Description
path String value that specifies the location of the XML file.

This property can be a relative or absolute path:

  • Relative path: The path of the file relative to the current page location (for example, "~/note.xml")
  • Absolute path: An absolute path (for example, "C:xmlnote.xml")


Example

Example

The following example sets the XML document to be used by the Xml control:

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

Demo Example »

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


XML 控件XML Control Other Extensions