Làm sao để cấu hình nhiều web.sitemap trong ASP.NET

1. Cấu hình web.config

<siteMap defaultProvider=”AspNetXmlSiteMapProvider” enabled=”true”>
<providers>
<add name=”AdminSiteMapProvider” description=”The site map provider that reads in the Admin.sitemap XML files.” type=”System.Web.XmlSiteMapProvider” siteMapFile=”~/MasterPages/Web.Sitemap”/>
</providers>
</siteMap>

2. Chỉ ra sitemapProvider trong SiteMapDataSource

<asp:SiteMapDataSource ID=”SiteMapDS1″ ShowStartingNode=”false” runat=”server” SiteMapProvider=”AdminSiteMapProvider” />

Advertisements

Nhiều web.sitemap trong web site

1. Cấu hình web.config

<siteMap defaultProvider=”AspNetXmlSiteMapProvider” enabled=”true”>
<providers>
<add name=”AdminSiteMapProvider”
description=”The site map provider that reads in the Admin.sitemap XML files.”
type=”System.Web.XmlSiteMapProvider”
siteMapFile=”~/MasterPages/Web.Sitemap”/>
</providers>
</siteMap>

2. Chỉ ra sitemapProvider trong SiteMapDataSource

<asp:SiteMapDataSource ID=”SiteMapDataSource1″ ShowStartingNode=”false” runat=”server” SiteMapProvider=”AdminSiteMapProvider” />