The SiteMapProvider class and is the default site map provider for ASP.NET. The class generates site map trees from XML files with the file name extension .sitemap.class is derived from the
Assembly: System.Web (in System.Web.dll)
Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).(Inherited from ProviderBase.)
Gets the friendly name used to refer to the provider during configuration.(Inherited from ProviderBase.)
Gets the root node of the site map.(Overrides SiteMapProvider.RootNode.)
Gets a Boolean value indicating whether a site map provider filters site map nodes based on a user's role.(Inherited from SiteMapProvider.)
Adds a SiteMapNode object to the collections that are maintained by the current provider.(Overrides StaticSiteMapProvider.AddNode(SiteMapNode, SiteMapNode).)
Links a child site map provider to the current provider.
Loads the site map information from an XML file and builds it in memory.(Overrides StaticSiteMapProvider.BuildSiteMap().)
Removes all elements in the collections of child and parent site map nodes and site map providers that the StaticSiteMapProvider.Clear().)object internally tracks as part of its state.(Overrides
This API supports the product infrastructure and is not intended to be used directly from your code. Notifies the file monitor of the Web.sitemap file that theobject no longer requires the file to be monitored.
Notifies the file monitor of the Web.sitemap file that the Dispose method takes a Boolean parameter indicating whether the method is called by user code.object no longer requires the file to be monitored. The
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Retrieves a SiteMapNode object based on a specified key.(Overrides StaticSiteMapProvider.FindSiteMapNodeFromKey(String).)
Provides an optimized lookup method for site map providers when retrieving the node for the currently requested page and fetching the parent and ancestor site map nodes for the current page.(Inherited from SiteMapProvider.)
Provides an optimized lookup method for site map providers when retrieving the node for the currently requested page and fetching the site map nodes in the proximity of the current node.(Inherited from SiteMapProvider.)
Serves as the default hash function. (Inherited from Object.)
Returns the parent node of the site map.(Overrides StaticSiteMapProvider.GetParentNode(SiteMapNode).)
Provides an optimized lookup method for site map providers when retrieving an ancestor node for the currently requested page and fetching the descendant nodes for the ancestor.(Inherited from SiteMapProvider.)
|GetParentNodeRelativeToNodeAndHintDownFromParent(SiteMapNode, Int32, Int32)|
Retrieves the top-level node of the current site map data structure.(Overrides SiteMapProvider.GetRootNodeCore().)
|HintNeighborhoodNodes(SiteMapNode, Int32, Int32)|
Provides a method that site map providers can override to perform an optimized retrieval of nodes found in the proximity of the specified node. (Inherited from SiteMapProvider.)
Initializes the Initialize method does not actually build a site map, it only prepares the state of the to do so.(Overrides SiteMapProvider.Initialize(String, NameValueCollection).)object. The
Removes a linked child site map provider from the hierarchy for the current provider.
Returns a string that represents the current object.(Inherited from Object.)
The SiteMapProvider and classes on the structure of the site map data:class loads site map data from an XML file that follows a known schema. The site map data is bounded by <siteMap> tags and consists of nested <siteMapNode> tags. Two constraints are imposed by the
Only one root node can exist.
For SiteMapNode objects that specify URLs, the URLs must be unique within the scope of the provider. (For nodes that do not specify URLs, all keys must be unique.)
The following code example shows an example of an XML file that can be used with the.
<siteMap> <siteMapNode title="RootNode" description="This is the root node of the site map. There can be only one root node." url="Page1.aspx" > <siteMapNode title="ChildofRootNode" description="Descriptions do not have to be unique." url="Page2.aspx"> <siteMapNode title="ChildOfChildNode" description="SiteMapNode objects can be nested to any level." url="Page3.aspx"/> </siteMapNode> <siteMapNode title="ChildofRootNode" description="Descriptions do not have to be unique." url="Page4.aspx"/> </siteMapNode> </siteMap>
Theis the default provider for ASP.NET and it reads XML data from a file named Web.sitemap that is located within the directory structure of the ASP.NET application. By default, the Web.sitemap file is located at the application root; however, if you want to change the name or location of the file from which the loads data, you can override the default configuration in your Web.config file. By overriding the default configuration settings in your Web.config file, you can tailor the behavior of the for each ASP.NET application, as necessary.
The following code example demonstrates an example Web.config file, where the SiteMapProviderCollection object must be named uniquely, the one that is specified in the Web.config file uses a name other than the default but is also set as the default provider so that it will be used instead of the that is specified in the default ASP.NET configuration.is still used, but a different site map file is used. Because all providers in a
You can change the name of the site navigation data file, but you cannot change its extension. Theonly reads data from files that are named with the file name extension .sitemap.
<siteMap defaultProvider="MyXmlSiteMapProvider" enabled="true"> <providers> <add name="MyXmlSiteMapProvider" description="SiteMap provider that reads in .sitemap files." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="CustomWeb.sitemap" /> </providers> </siteMap>
Available since 2.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.