Mega Code Archive

 
Categories / ASP.Net / Sitemap
 

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>