views:

167

answers:

2

I have created and asp.net web site utilizing a web.sitemap file to help with navigation. The site needs to be deployed within a virtual directory inside of our SharePoint intranet site. The problem that I am running in to is that when I request the SiteMap.CurrentNode property, it is returning information from SharePoint's sitemap. Specifically, when i try to get my sitemap's title or description, I am getting information from SharePoint. I have tried re-naming my sitemap and declaring a new Sitemap provider within the web.config. After creating the new sitemap provider and requesting the SiteMap.currentNode, I receive an error message saying that it can't find the web.sitemap file.

Any help you can provide would be greatly appreciated.

A: 

It sounds like you need to set the virtual directory as an Application within IIS - doing this will:

  • reset the "base" directory of your application to the root of the virtual directory, so that relative paths in your web.config point to the correct location, and
  • cause the website to ignore any settings defined any Sharepoint web.config files defined in parent folders, and
  • should also make your sitemap file the default (because it won't look at any web.config or sitemaps in parent directories).

There are other differences, but these two seem to be the cause of the problems you've outlined.

Dexter
A: 

I was able to figure out the problem...It turns out that when I declared the new site map provider within the web.config, I didn't set the defaultProvider value. Once the default provider was set to the new provider's name, everything worked as expected.

<siteMap enabled="true" defaultProvider="CPSiteMap">
  <providers>
    <add name="CPSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="AccountMaintenance.sitemap" />
  </providers>
</siteMap>

I hope this helps someone else.

Edison