<?xml version="1.0" encoding="utf-8" ?> <siteMap> <siteMapNode title="Default" description="Home" url="Default.aspx" > <siteMapNode title="Members" description="Members" url="Members.aspx"> <siteMapNode title="My Account" description="My Account" url="MyAccount.aspx" /> <siteMapNode title="Products" description="Products" url="Products.aspx" /> </siteMapNode> <siteMapNode title="Administration" description="Administration" url="~/Admin/Default.aspx"> <siteMapNode title="Customer" description="Customer Admin" url="~/Admin/Customer/default.aspx" /> <siteMapNode title="Products Admin" description="Products Admin" url="~/Admin/ProductsAdmin.aspx" /> </siteMapNode> </siteMapNode> </siteMap> |
<%@ Master Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Master Page</title> </head> <body> <form id="form1" runat="server"> <div> <table style="width: 100%; height: 100%" border="1"> <tr> <td style="width: 10%"> <asp:TreeView ID="TreeView1" Runat="server" DataSourceID="SiteMapDataSource1" ExpandDepth="2" ShowExpandCollapse="False" NodeIndent="10"> <LevelStyles> <asp:TreeNodeStyle Font-Bold="True" Font-Underline="False"/> <asp:TreeNodeStyle Font-Italic="True" Font-Underline="False" /> <asp:TreeNodeStyle Font-Size="X-Small" ImageUrl="bullet.gif" Font-Underline="False" /> </LevelStyles> <NodeStyle ChildNodesPadding="10" /> </asp:TreeView> </td> <td style="width: 100px"> <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"> </asp:contentplaceholder> </td> </tr> </table> <asp:SiteMapDataSource ID="SiteMapDataSource1" Runat="server"/> </div> </form> </body> </html> |
<%@ Page Language="C#" MasterPageFile="Navigation.master" Title="Default Page"%> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="Content1" Runat="Server"> This is the default page </asp:Content> |
|
<tr height="100px"> <td colspan="2" align="left"> <asp:Menu ID="Menu1" Runat="Server" DataSourceID="SiteMapDataSource1"> </asp:Menu> </td> </tr> |
|
<tr height="100px"> <td colspan="2" align="left"> Currently Selected Page is: <asp:SiteMapPath Runat="Server" ID="SiteMapPath1"></asp:SiteMapPath> </td> </tr> |
<%@ Page Language="C#" MasterPageFile="Navigation.master" Title="Members Page"%> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="Content1" Runat="Server"> This is the members page </asp:Content> |
<%@ Page Language="C#" MasterPageFile="Navigation.master" Title="Members Page"%> <script runat="Server"> void Page_Load(object sender, EventArgs e) { Response.Write("The currently selected root node is: " + SiteMap.CurrentNode.Description + "<br>"); Response.Write("The Parent for the currently selected node is : " + SiteMap.CurrentNode.ParentNode.Description); } </script> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="Content1" Runat="Server"> This is the members page </asp:Content> |
|