当有多个SiteMap文件时,如何让SiteMapDataSource选择特定的SiteMap文件
来源:互联网 发布:创建oracle数据库 编辑:程序博客网 时间:2024/04/28 04:05
当有多个SiteMap文件时,如何让SiteMapDataSource选择特定的SiteMap文件
由于前段时间做的网站都只有一个sitemap文件,当有多个sitemap文件的时候,就不知道如何让SiteMapDataSource选择特定的那个SiteMap文件了,文档上也找不着,那就一直搁着,今天看了一个DEMO,原来是如此简单:
例如现在在网站的根目录上有两个SiteMap文件,分别是web1.sitemap和web2.sitemap
打开web.config文件
在<system.web>下添加以下内容:
<siteMap>
<providers>
<add name="web1sitemap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/web1.sitemap" />
<add name="web2sitemap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/web2.sitemap" />
</providers>
</siteMap>
那么让SiteMapDataSource选择前者,就把他的SiteMapProvider属性设置为"web1SiteMap"
同理要选择后者,就设为"web2SiteMap"
简单吧!
由于前段时间做的网站都只有一个sitemap文件,当有多个sitemap文件的时候,就不知道如何让SiteMapDataSource选择特定的那个SiteMap文件了,文档上也找不着,那就一直搁着,今天看了一个DEMO,原来是如此简单:
例如现在在网站的根目录上有两个SiteMap文件,分别是web1.sitemap和web2.sitemap
打开web.config文件
在<system.web>下添加以下内容:
<siteMap>
<providers>
<add name="web1sitemap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/web1.sitemap" />
<add name="web2sitemap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/web2.sitemap" />
</providers>
</siteMap>
那么让SiteMapDataSource选择前者,就把他的SiteMapProvider属性设置为"web1SiteMap"
同理要选择后者,就设为"web2SiteMap"
简单吧!
- 当有多个SiteMap文件时,如何让SiteMapDataSource选择特定的SiteMap文件
- 当有多个SiteMap文件时,如何让SiteMapDataSource选择特定的SiteMap文件
- 让SiteMapDataSource选择特定的SiteMap
- 如何让SiteMapPath使用指定路径指定名称的sitemap文件。
- 如何让SiteMapPath使用指定路径指定名称的sitemap文件。
- 如何让SiteMapPath使用指定路径指定名称的sitemap文件。
- sitemap文件很大该怎么办? sitemap 分割
- 如何让帝国CMS如何自动生成sitemap.xml网站地图文件
- ***.sitemap
- 关于.net的web.sitemap的文件的问题
- 快速制作网站地图文件sitemap的方法
- c#中SiteMap文件的创建及使用
- sitemap文件生成的java实现思路(转)
- 生产Google Sitemap XML文件的PHP代码
- python生成百万级URL的sitemap文件
- Sitemap制作攻略&Sitemap生成器的评测
- 添加静态的sitemap的html等静态文件给自己的网站添加静态的sitemap的html等静态文件
- django项目中如何把sitemap.xml等静态文件放到web根目录
- 开张啦
- oBlog313 ACCESS免费版到SQLSERVER版的转换过程(修改进行中,欢迎跟贴)
- EasyMock实践指南
- 蝴蝶不飞
- 关于成功的7个小故事
- 当有多个SiteMap文件时,如何让SiteMapDataSource选择特定的SiteMap文件
- 通用的数据分页的存储过程 [转]
- 将中文转成拼音SQL版[转]
- 终于申请blog成功
- JBoss3.0 下配置和部署EJB简介(转自:赵晨希)
- Rootkit Detection and Removal
- IT人的通病
- 编译asp.net用到的批处理文件
- CCNA 640-801:路由器初学者完全教程