面包屑导航

web.sitemap

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="default.aspx" title="1"  description="">
    <siteMapNode  url="default2.aspx" title="1-1"  description="" >
      <siteMapNode url="default3.aspx" title="1-1-1"  description=""></siteMapNode>
      <siteMapNode url="default4.aspx" title="1-1-2"  description="">
        <siteMapNode url="default5.aspx" title="1-1-2-1"  description=""></siteMapNode>
      </siteMapNode>
    </siteMapNode>
  </siteMapNode>
</siteMap>

web.config

    <system.web>

    <siteMap enabled="true" defaultProvider="XmlSiteMapProvider">
      <providers>
        <add name="XmlSiteMapProvider"  type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="Web.sitemap"/>
      </providers>
      
    </siteMap>
</system.web>

 

前台页面:

<%@ Page Language="C#"  AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="Default5" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:SiteMapPath id="SiteMapPath"  SiteMapProvider="XmlSiteMapProvider"  runat="server">
    
    </asp:SiteMapPath>
 
    </div>
    </form>
</body>
</html>

 

posted @ 2015-02-12 16:14  Asilan  阅读(139)  评论(0编辑  收藏  举报