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” />

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s