Asp.net Web.config - 将站点地图提供程序移至 web.config 之外
我们可以将连接字符串移动到一个单独的文件中,即:
<connectionStrings configSource="ConnectionStrings.config"/>
将站点地图部分移到 web.config 之外会很有用
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
.... add ther providers here name here....
</providers>
</siteMap>
,我当前添加一个
在
部分中并将站点地图添加到站点。
具有许多页面和不同菜单的网站受益于许多站点地图。
我想添加它们而不必更新 web.config。 (IE 在自己的代码中将此部分添加并添加新的站点地图。)
vs2008 intellisense 确实将 configSource 显示为有效,但我无法使其正常工作。
是否允许在 web.config 中实现?如果是这样,我们将不胜感激工作代码的示例。
We can move our connectionStrings to a separate file ie:
<connectionStrings configSource="ConnectionStrings.config"/>
It would be useful to move the sitemap section outside of web.config
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
.... add ther providers here name here....
</providers>
</siteMap>
I currently add an <add name="" ..... />
inside the <providers>
section and add a sitemap to the site.
A site with many pages with diverse menus benefit from many sitemaps.
I would like to add them without having to update the web.config. (IE put and add in this section in its own code and add the new sitemap.)
vs2008 intellisense does show configSource as valid, but I have not been able to get this to work.
Is it allowed implemented in web.config? If so an example of working code would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定是否将站点地图信息添加到 web.config,但看起来您确实可以使用多个站点地图文件。默认站点地图文件是 web.sitemap,然后您可以添加任意数量的子站点地图文件。
请参阅此链接:
http://msdn.microsoft。 com/en-us/library/ms178426(v=VS.90).aspx
I'm not sure about adding the sitemap information to the web.config, but it does look like you can use multiple sitemap files. The default sitemap file is web.sitemap and then you can add any number of child sitemap files.
See this link:
http://msdn.microsoft.com/en-us/library/ms178426(v=VS.90).aspx
我有它的工作:
Web.config 现在有一行:
我现在有一个名为 MySiteMaps.config 的文件,其中包含:
工作正常。
对我来说唯一的问题是 MySiteMaps.config 文件中 siteMap 元素下的小蓝线。 “‘siteMap’元素未声明。”
希望这有帮助!
我正在研究蓝色的波浪线。我可以忍受它,但我不喜欢松散的结局。
麦克风
I have it working:
The Web.config now has a line:
And I now have a file Called MySiteMaps.config containing:
Works just fine.
The only issue for me is the little blue line under the siteMap element in the MySiteMaps.config file. "The 'siteMap' element is not declaired."
Hope this helps!
I am researching the blue squigly line. I could live with it, but I don't like loose ends.
Mike