A site map is a standard XML file with the extension. sitemap. It defines the structure of the entire site, links to various pages, related descriptions, and other related definitions. The document structure of a site map consists of multiple node elements at different levels. The file contains a root node sitemap, which contains multiple sitemapnode byte points under the root node, the sitemapnode node contains the following attributes:
Name |
Description |
URL |
Set the URL address used for node navigation. This attribute value must be unique in the whole site map file. |
Title |
Set the node name. |
Description |
Set the description of the node. |
Keyword |
Defines the keywords that indicate the current node. |
Roles |
Defines the role set that allows you to view the map file of the site. Multiple roles can be separated by (;) and. |
Sitemapfile |
Set the site map file that contains other related sitemapnode elements. |
Provider |
Define the site navigation for processing other Site Map FilesProgramName. The default value is xmlsitemapprovider. |
Site Map example
<? XML version = "1.0" encoding = "UTF-8" ?>
< Sitemap >
< Sitemapnode Title = "Homepage" URL = "Default. aspx" >
< Sitemapnode Title = "Computer books" URL = "Sitemapsa. aspx" >
< Sitemapnode Title = "Programming Language" URL = "Sitemapsa1.aspx" />
< Sitemapnode Title = "Network application" URL = "Sitemapsa2.aspx" />
< Sitemapnode Title = "Office software" URL = "Sitemapsa3.aspx" />
</ Sitemapnode >
< Sitemapnode Title = "Human books" URL = "Sitemapsb. aspx" >
< Sitemapnode Title = "History" URL = "Sitemapsb4.aspx" >
< Sitemapnode Title = "Modern History" URL = "Sitemapsb4a. aspx" />
< Sitemapnode Title = "Modern History" URL = "Sitemapsb4b. aspx" />
</ Sitemapnode >
< Sitemapnode Title = "Economic" URL = "Sitemapsb5.aspx" />
< Sitemapnode Title = "Education" URL = "Sitemapsb6.aspx" />
</ Sitemapnode >
< Sitemapnode Title = "Natural science books" URL = "Sitemapsc. aspx" />
</ Sitemapnode >
</ Sitemap >
Configure multiple site maps and site map providers
If you want to configure multiple site maps and site map providers on one site,To be modifiedWeb. configFile,RequiredAddProperty to add the custom site map providerWeb. configFile<System. Web>Node.You can also set a site map provider as the default site map provider.
See the following Web. config Two Xmlsitemapprovider, They are Defaultsitemap And Adminsitemap. Where Defaultsitemap Is set as the default site map provider.Web. config
< System . Web >
< Sitemap Defaultprovider = "Defaultsitemap" >
< Providers >
< Add
Name = "Defaultsitemap"
Type = "System. Web. xmlsitemapprovider"
Sitemapfile = "~ /Web. sitemap" />
< Add
Name = "Adminsitemap"
Type = "System. Web. xmlsitemapprovider"
Sitemapfile = "~ /Admin/Web. sitemap" />
</ Providers >
</ Sitemap >
</ System. Web >
they are the default site map providers and the site map providers in the management folder .
you can use the map providers of the sites. :
sitemapprovider of sitemappath is omitted , it uses the default site map provider.
use adminsitemap site map providers
of course, , other navigation controls, such as menu and Treeview , can be used similarly.