Using two web.sitemap file in a single project

Using two web.sitemap file in a single project

There may be cases where we need to use different sitemaps in a single project. This can be done by adding the provider names in web.config file as follows.
 <providers>
      <add
         name=”adminlinks”
         type=”System.Web.XmlSiteMapProvider”
         siteMapFile=”~/admin/admin.sitemap” />
       <add
         name=”userlinks”
         type=”System.Web.XmlSiteMapProvider”
         siteMapFile=”~/user/user.sitemap” />
    </providers>

Then you can assign SiteMapProvider to SiteMapDataSource as following, and you can bind your Menu control or tree view control to different SiteMapDataSource.
<asp:SiteMapDataSource ID=”SiteMapDataSource1″  runat=”server” SiteMapProvider=”adminlinks” />

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.