I want to configure multiple sitemaps due to the size of sitemaps in my application.
由于应用程序中站点地图的大小,我想配置多个站点地图。
Is there a way to do that?
有没有办法做到这一点?
Thanks in advance.
提前致谢。
1 个解决方案
#1
0
ASP.NET works with XML files for site navigation, by default it uses Web.sitemap that describes the hierarchy of the web site. However we can configure it to use more than one site-map fiile or site-map provider for navigation structure.
ASP.NET使用XML文件进行站点导航,默认情况下,它使用描述Web站点层次结构的Web.sitemap。但是,我们可以将其配置为使用多个站点地图文件或站点地图提供程序来导航结构。
Eg.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home Page" description="">
<siteMapNode title="Category 1" description="" />
<siteMapNode title="Category 2" description="">
<siteMapNode title="Sub Category 1" description=""/>
<siteMapNode title="Sub Category 2" description=""/>
</siteMapNode>
<siteMapNode siteMapFile="child.sitemap" />
</siteMapNode>
</siteMap>
The child map could be the following:
子地图可能如下:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Child Category 1" description="">
<siteMapNode title="Child Sub Category 1" description="" />
<siteMapNode title="Child Sub Category 2" description="" />
<siteMapNode title="" description="" />
</siteMapNode>
</siteMap>
The Result will be
结果将是
Home Page
Category 1
Category 2
Sub Category 1
Sub Category 2
Child Category 1
Child Sub Category 1
Child Sub Category 2
The below line links the style:
以下行链接样式:
<siteMapNode siteMapFile="MySiteMap.sitemap" />
#1
0
ASP.NET works with XML files for site navigation, by default it uses Web.sitemap that describes the hierarchy of the web site. However we can configure it to use more than one site-map fiile or site-map provider for navigation structure.
ASP.NET使用XML文件进行站点导航,默认情况下,它使用描述Web站点层次结构的Web.sitemap。但是,我们可以将其配置为使用多个站点地图文件或站点地图提供程序来导航结构。
Eg.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home Page" description="">
<siteMapNode title="Category 1" description="" />
<siteMapNode title="Category 2" description="">
<siteMapNode title="Sub Category 1" description=""/>
<siteMapNode title="Sub Category 2" description=""/>
</siteMapNode>
<siteMapNode siteMapFile="child.sitemap" />
</siteMapNode>
</siteMap>
The child map could be the following:
子地图可能如下:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Child Category 1" description="">
<siteMapNode title="Child Sub Category 1" description="" />
<siteMapNode title="Child Sub Category 2" description="" />
<siteMapNode title="" description="" />
</siteMapNode>
</siteMap>
The Result will be
结果将是
Home Page
Category 1
Category 2
Sub Category 1
Sub Category 2
Child Category 1
Child Sub Category 1
Child Sub Category 2
The below line links the style:
以下行链接样式:
<siteMapNode siteMapFile="MySiteMap.sitemap" />