简体   繁体   English

SharePoint虚拟目录站点地图

[英]SharePoint Virtual Directories Sitemap

I have created and asp.net web site utilizing a web.sitemap file to help with navigation. 我已经创建了一个利用web.sitemap文件来帮助导航的asp.net网站。 The site needs to be deployed within a virtual directory inside of our SharePoint intranet site. 该网站需要部署在我们的SharePoint Intranet网站内部的虚拟目录中。 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. 我遇到的问题是,当我请求SiteMap.CurrentNode属性时,它正在从SharePoint的站点地图返回信息。 Specifically, when i try to get my sitemap's title or description, I am getting information from SharePoint. 具体来说,当我尝试获取站点地图的标题或描述时,我正在从SharePoint获取信息。 I have tried re-naming my sitemap and declaring a new Sitemap provider within the web.config. 我尝试重新命名站点地图并在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. 创建新的站点地图提供程序并请求SiteMap.currentNode之后,我收到一条错误消息,提示它找不到web.sitemap文件。

Any help you can provide would be greatly appreciated. 您能提供的任何帮助将不胜感激。

It sounds like you need to set the virtual directory as an Application within IIS - doing this will: 听起来您需要将虚拟目录设置为IIS中的应用程序-这样做将:

  • 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 将应用程序的“基本”目录重置为虚拟目录的根目录,以使web.config中的相对路径指向正确的位置,并且
  • cause the website to ignore any settings defined any Sharepoint web.config files defined in parent folders, and 使网站忽略在父文件夹中定义的所有Sharepoint web.config文件中定义的任何设置,以及
  • should also make your sitemap file the default (because it won't look at any web.config or sitemaps in parent directories). 还应将您的站点地图文件设置为默认文件(因为它将不会查看父目录中的任何web.config或站点地图)。

There are other differences , but these two seem to be the cause of the problems you've outlined. 还有其他差异 ,但是这两个似乎是您所概述的问题的原因。

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. 我能够找出问题所在……事实证明,当我在web.config中声明新的站点地图提供程序时,我没有设置defaultProvider值。 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. 我希望这可以帮助其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM