Partager via


TREENODESRC Attribute | TreeNodeSrc Property

Sets or retrieves a value that indicates the URL of an XML file, string, or XML data island containing TreeNode elements.

Syntax

Visual Basic  Public  Property TreeNodeSrc As string
C# public  string TreeNodeSrc { get; set; }
Managed C++ public:  __property string get_TreeNodeSrc();
public:  __property void set_TreeNodeSrc(string);
JScript public   function get TreeNodeSrc() : string;
public   function set TreeNodeSrc(string);

Possible Values

sTreeNodeSrc A value that indicates the URL of an XML file, string, or XML data island containing TreeNode elements.

The property is read/write. The property has no default value.

Remarks

You can encapsulate and reuse trees or pieces of trees in an XML data island. The XML file must contain only TreeNode elements wrapped in opening and closing TREENODES tags.

When TreeNodeSrc is a property of the TreeView element, the content of the XML data island renders in place of any content of TreeView. However, the TreeNodeType elements within the TreeView are not replaced.

When TreeNodeSrc is a property of the TreeNode element, the XML data island renders as child nodes of the TreeNode element.

The XML data island inherits the namespace of the databound element. The XML file must not contain any namespaces.

The XML data island must be syntactically well-formed XML.

You can transform the XML file specified by this property by setting the TreeNodeXsltSrc property to the URL of an Extensible Stylesheet Language (XSL) style sheet.

Examples

This is an example of an XML data island.

<TREENODES>
    <TREENODE TEXT="Document-1" IMAGEURL="folder.gif"
        EXPANDEDIMAGEURL="folderopen.gif"/>
    <TREENODE TEXT="Folder-1" EXPANDED="true"
        IMAGEURL="folder.gif" EXPANDEDIMAGEURL="folderopen.gif">
        <TREENODE TEXT="Document-2" />
        <TREENODE TEXT="Document-3" />
    </TREENODE>
    <TREENODE TEXT="Document-4" IMAGEURL="folder.gif"/>
</TREENODES>

Applies To

TREENODE, TREEVIEW

See Also

Internet Explorer WebControls, About the TreeView WebControl