Sitemap and tree view : SiteMapDataSource « Sitemap « ASP.Net






Sitemap and tree view



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html>
  <head>
    <title>TreeView Demo</title>
  </head>
  <body>
    <form runat="server">
      <asp:SiteMapDataSource ID="mySiteMapDataSource"
          runat="server" />
      <asp:TreeView ID="myTreeView" runat="server"
          DataSourceID="mySiteMapDataSource" />
    </form>
  </body>
</html>

File: Web.sitemap

<siteMap
    xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
  <siteMapNode title="Home" url="~/Default.aspx"
      description="Home">
    <siteMapNode title="TreeViewDemo" url="~/TreeViewDemo.aspx" 
        description="TreeView Example" />
    <siteMapNode title="ClickEvent" url="~/ClickEvent.aspx"
        description="ClickEvent Example" />
    <siteMapNode title="Loops"  url="~/Loops.aspx"
        description="Loops Example" />
  </siteMapNode>
</siteMap>

 








Related examples in the same category

1.Binding a GridView with the SiteMapDataSource control
2.Programmatical Custom Navigation
3.Simple SiteMap
4.Partial SiteMaps
5.Menu and SiteMap
6.SiteMap And MasterPage
7.Basic navigation
8.Advanced Navigation