The ASP.NET 3.5 Framework includes two hierarchical DataBound controls : TreeView « Data Binding « ASP.NET Tutorial






Menu: Displays data items in a static or dynamic menu.

TreeView: Displays data items in a tree.

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <form id="form1" runat="server">

    <div class="floater">
    <h3>TreeView</h3>
    <asp:TreeView
        id="CheckBoxList1"
        DataSourceId="srcData"
        Runat="server" />
    </div>

    <div class="floater">
    <h3>Menu</h3>
    <asp:Menu
        id="BulletedList1"
        DataSourceId="srcData"
        Runat="server" />
    </div>

    <asp:XmlDataSource
        id="srcData"
        DataFile="~/Data.xml"
        XPath="/movies/*"
        Runat="server" />

    </form>
</body>
</html>

File: Data.xml

<movies>
  <Adventure>
    <StarWars />
    <JurassicPark />
    <IndependenceDay />
  </Adventure>
  <Animation>
    <IceAge />
    <Shrek />
  </Animation>
  <Drama>
    <Titanic />
    <Ghost />
    <ForrestGump />
  </Drama>
  <Horrer>
    <Jaws />
    <TheRing />
  </Horrer>
</movies>








19.26.TreeView
19.26.1.The ASP.NET 3.5 Framework includes two hierarchical DataBound controls
19.26.2.Fibonacci Tree On Demand
19.26.3.On demand file