SiteMapPath使用方法
<asp:SiteMapPath ID="SiteMapPath1" runat="server" CssClass="sitemap" RenderCurrentNodeAsLink="True" SiteMapProvider="SiteMapPath1" >
<RootNodeStyle CssClass="first" />
<NodeStyle CssClass=""/>
<CurrentNodeStyle CssClass="last" />
<PathSeparatorStyle CssClass="bc-seperator" />
<PathSeparatorTemplate>
</PathSeparatorTemplate>
</asp:SiteMapPath>
Web.sitemap 代码
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="index.aspx" title="首页" description="">
<siteMapNode url="list.aspx" title="列表页" description="">
<siteMapNode url="Detail.aspx" title="详细信息页" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
web.config的代码
<siteMap defaultProvider="SiteMapPath1" enabled="true">
<providers>
<add name="SiteMapPath1" description="SiteMap provider which reads in .sitemap XML files." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="Web.sitemap" securityTrimmingEnabled="true" />
</providers>
</siteMap>