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 a Boolean value indicating whether a site map provider filters site map nodes based on a user's role.(Inherited from SiteMapProvider.)
When overridden in a derived class, loads the site map information from persistent storage and builds it in memory.
Removes all elements in the collections of child and parent site map nodes that thetracks as part of its state.
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.)
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.)
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)|
When overridden in a derived class, retrieves the root node of all the nodes that are currently managed by the current provider. (Inherited from SiteMapProvider.)
|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.)
Returns a string that represents the current object.(Inherited from Object.)
The XmlSiteMapProvider) that translates a site map that is stored in persistent storage to one that is stored in memory. The class provides basic implementations for storing and retrieving SiteMapNode objects.class supports writing a site map provider (for example, an
The SiteMapProvider and classes support the concept of a site map provider hierarchy, where a site map provider can have a hierarchical relationship with other site map providers. This pattern is implemented with the RootProvider and ParentProvider properties.
The SiteMapNode objects in hash tables and internally uses the SiteMapNode.Url property of the pages, represented by site map nodes, as keys. (If a site map node does not specify a URL, it is tracked using an automatically generated unique key.) As a result, you cannot have site map nodes wherein a site map node with the same URL is used more than once. For example, attempting to load the site map node illustrated in the following code example with the XmlSiteMapProvider class, which is the default ASP.NET site map provider, or any site map provider that is derived from the class will not work because the AboutUs.aspx page is used more than once.class stores its
<sitemap> <sitemapnode title="Home" description="Home" url="default.aspx" > <sitemapnode title="Catalog" description="Our catalog" url="catalog.aspx"/> <sitemapnode title="About Us" description="All about our company" url="aboutus.aspx"/> <sitemapnode title="Driving Directions" description="Directions to our store" url="aboutus.aspx"/> </sitemapnode> </sitemap>
If you are extending the GetRootNodeCore, Initialize, and BuildSiteMap methods. The Clear and FindSiteMapNode methods have default implementations that are sufficient for most custom site map provider implementations.class, the three most important methods are the
The Initialize method is called to initialize derived site map providers, including any resources that are required to load site map data, but it does attempt to build the site map node in memory. If your derived class is using files to store site map data, any file initialization can be performed here. If the site map node uses some other type of data store, such as a relational database, initializing a connection might be performed here. Additional attributes, such as file names or connection strings that are placed on the site map provider element in the configuration are processed by the ASP.NET configuration system and passed to the Initialize method with the attributes parameter.
The BuildSiteMap method must be overridden by all classes that are derived from the class and is called to load the site map node from persistent storage and convert it to an internal representation. The BuildSiteMap method is called internally in many of the default member implementations of the and XmlSiteMapProvider classes. If you implement your own site map provider, ensure that site map data processing occurs once and subsequent calls to the BuildSiteMap method return immediately, if site map information has already been loaded. When you implement the BuildSiteMap method, ensure it is thread safe, as multiple concurrent page requests can result indirectly in multiple calls to load site map information. The site map infrastructure supports displaying site map information based on the user's role. Depending on the Roles property that are supported by the individual SiteMapNode objects, a different navigation structure can exist for different users. The default implementations of the site map node retrieval members of the class perform security trimming automatically by calling the IsAccessibleToUser method.
Notes to Inheritors:
When you inherit from the BuildSiteMap.class, you must override the following member:
The following code example demonstrates how you to extend the AccessSiteMapProvider class is a site map provider that supports only a simple, one-level-deep hierarchy. The table that the site map data is stored in has the following structure:class to use Microsoft Access as a site map provider. The
NODEID URL NAME PARENTNODEID --------------------------------------------- 1 default.aspx Default <NULL> 2 catalog.aspx Catalog 1 3 aboutus.aspx Contact Us 1 ...
Finally, the AccessSiteMapProvider is configured as the default provider in the following Web.config file.
<configuration> <system.web> <siteMap defaultProvider="AccessSiteMapProvider"> <providers> <add name="AccessSiteMapProvider" type="Samples.AspNet.AccessSiteMapProvider,Samples.AspNet " accessSiteMapConnectionString="PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=sitemap.mdb "/> </providers> </siteMap> </system.web> </configuration>
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.