关键代码: Web.config <system.web><siteMap defaultProvider="WebSiteMap"> <providers> <add name="WebSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/> </providers> </siteMap></system.web> Default.aspx <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SiteMapDataSource1" EnableViewState="false"> <ItemTemplate> <asp:HyperLink ID="SamplesLink" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("Url") %>' EnableViewState="false" /><br /></ItemTemplate> </asp:Repeater> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="WebSiteMap" ShowStartingNode="false" /> 转载于:https://www.cnblogs.com/ajaxworld/archive/2007/06/26/796027.html