maartenba / MvcSiteMapProvider

An ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework.
Microsoft Public License
539 stars 218 forks source link

Multiple Sitemap files without using DI #471

Open vikasNew opened 7 years ago

vikasNew commented 7 years ago

i need to use multiple sitemap files in my MVC application for different Areas.

i am using mvcsitemapprovider v4 version.

How can i do this without using DI.

I tried this by adding below code in my web.config, but this does not work.

`

`

also i used the below code to call them..

`var currentArea = (string)ViewContext.RouteData.DataTokens["area"]; if (string.IsNullOrWhiteSpace(currentArea)) {

@Html.MvcSiteMap("AppSiteMapProvider").SiteMapTitle()

} else if (currentArea.ToString() == "Admin") {

@Html.MvcSiteMap("AdminSiteMapProvider").SiteMapTitle()

}`

Please help me on this.

Thanks in anticipation.