Web.sitemap檔案預設是放在根目錄下且不能改名
是給一些導覽控制項用的
像是Menu控制項(還要放個SiteMapDataSource)
TreeView控制項(還要放個SiteMapDataSource)
SiteMapPath控制項(直接會去讀根目錄下的Web.sitemap檔)
如果要用多個Web.sitemap的話
就去Web.Config裡面設定
<system.web>
<sitemap>
<providers>
<add name="myProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="myWeb2.sitemap"/>
</providers>
</sitemap>
</system.web>
然後把上面的myProvider的name設定到
SiteMapDataSource或是SiteMapPath就可用對應的sitemap檔了
全站熱搜