System.Web 2.0.0.0 System.Web.SiteMapProvider

The class is a partial implementation of the abstract class and supplies two additional methods: and , as well as the abstract and protected methods.

The class supports writing a site map provider (for example, an ) 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 objects.

The 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 and properties.

The class stores its objects in hash tables and internally uses the 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 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.

`<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 class, the three most important methods are the , , and methods. The and methods have default implementations that are sufficient for most custom site map provider implementations.

The 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 method with the parameter.

The 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 method is called internally in many of the default member implementations of the and classes. If you implement your own site map provider, ensure that site map data processing occurs once and subsequent calls to the method return immediately, if site map information has already been loaded. When you implement the 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 property that are supported by the individual 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 method.

The , and methods manipulate the internal collections that are used to track site map nodes in a thread-safe manner.

Serves as a partial implementation of the abstract class and serves as a base class for the class, which is the default site map provider in ASP.NET.

- Constructor

  Note This class is not instantiated directly. This constructor is called from the constructor of classes that are derived from the class.

  Initializes a new instance of the class.

  2.0.0.0
- Method
  2.0.0.0
  System.Void `` ``

  The site map node that is identified by the parameter is added to an internal collection and a parent-child relationship is created between it and the site map node that is identified by the parameter.

  The URL for a site map node might be interpreted when it is added to the internal collections. Application-relative and relative URLs are expanded to application-absolute virtual paths, which are then used internally to store and access the individual instances of the class. Other URLs, such as physical paths, paths with protocols in them, and UNC paths, are not interpreted.

  The class, which is derived from the class, and is the default site map provider for ASP.NET, uses the property of a object as a lookup key in its internal collections, by default. If the property of the is set, it must be unique within the scope of the site map provider. The method attempts to retrieve site map nodes based on their property. Otherwise, you can use the property and the corresponding method to retrieve site map nodes. If no or is specified, the site map provider automatically generates a to track the site map nodes.

  Adds a to the collections that are maintained by the site map provider and establishes a parent/child relationship between the objects.

  The to add to the site map provider. The under which to add .
- Method
  System.Web.SiteMapNode

  The method is the one abstract member of the class. The method is called to load and build the site map node from persistent storage. When you implement the method, ensure that it is thread-safe, because multiple concurrent page requests can result indirectly in multiple calls to load site map information.

  When overridden in a derived class, loads the site map information from persistent storage and builds it in memory.

  The root of the site map navigation structure.

  2.0.0.0
- Method
  System.Void

  Classes that are derived from the class can override the method to perform additional cleanup, depending on what state the derived classes maintain.

  The method does not reset state that is initialized during the method—it resets only state that is initialized during the method.

  Removes all elements in the collections of child and parent site map nodes that the tracks as part of its state.

  2.0.0.0
- Method
  System.Web.SiteMapNode ``

  The provided URL is typically a virtual or absolute URL. It can also be a URL that uses ASP.NET application-relative syntax, such as "~/". The class automatically normalizes application-relative raw URLs to an absolute virtual path.

  The object, which is derived from the and is the default site map provider for ASP.NET, uses the property of a object as a lookup key in its internal collections, by default. If the property of the is set, it must be unique within the scope of the site map provider. The method attempts to retrieve site map nodes based on their . Otherwise, you can use the property and the corresponding method to retrieve site map nodes. If no or is specified, the site map provider automatically generates a property to track the site map nodes.

  Retrieves a object that represents the page at the specified URL.

  A that represents the page identified by ; otherwise, null, if no corresponding site map node is found.

  A URL that identifies the page for which to retrieve a . 2.0.0.0
- Method
  System.Web.SiteMapNode ``

  The method retrieves a site map node from an internal object based on .

  The object, which is derived from the class and is the default site map provider for ASP.NET, uses the property of a object as a lookup key in its internal collections, by default. If the property of the is set, it must be unique within the scope of the site map provider. The method attempts to retrieve site map nodes based on their . Otherwise, you can use the property and the corresponding method to retrieve site map nodes.

  The has a default implementation that looks up instances of the class based on the parameter. If a site map provider implementer used the method, the already will have stored a reference to each based on the value of the property. By default, the generates GUIDs for instances of the class that do not have a value for the property. Custom site map provider implementers must provide their own mechanism for generating unique values of the property in the event that an instance of the class does not have a value for the property.

  The and classes, which are the default site map provider implementation for ASP.NET, use the URL of a object as a key in the various collections that the classes maintain.

  Retrieves a object based on a specified key.

  A that represents the page identified by ; otherwise, null, if security trimming is enabled and the site map node cannot be shown to the current user or the site map node is not found in the site map node collection by .

  A lookup key with which a is created. 2.0.0.0
- Method
  System.Web.SiteMapNodeCollection ``

  The objects delegate to the site map provider to keep track of their child and parent site map nodes. As a result, classes that implement a site map provider for a hierarchical site map structure, such as , and use objects to represent site map nodes, must track the hierarchical relationships of all site map nodes in order to be able to navigate an entire hierarchical tree.

  The method calls the method internally to retrieve read-only collection of site map nodes that are relative to the specified site map node and relevant to the current user.

  Retrieves the child site map nodes of a specific object.

  A read-only that contains the child site map nodes of . If security trimming is enabled, the collection contains only site map nodes that the user is permitted to see.

  The for which to retrieve all child site map nodes. 2.0.0.0
- Method
  System.Web.SiteMapNode ``

  The objects delegate to the site map provider to keep track of their child and parent site map nodes. As a result, classes that implement a site map provider for a hierarchical site map structure, such as the class, and use objects to represent site map nodes, must track the hierarchical relationships of all site map nodes in order to be able to navigate an entire hierarchical tree.

  If a property is not found, the class detects whether the current site map provider has a property. If so, the site map provider calls the property for the parent site map provider. This enables the scenario where the parent site map node of a site map node is maintained by a different site map provider.

  The method calls the method internally to retrieve the that represents the parent of the specified site map node. If security trimming is enabled, the site map node is returned only if the user is permitted to see it.

  Retrieves the parent site map node of a specific object.

  A that represents the parent of the specified ; otherwise, null, if no parent site map node exists or the user is not permitted to see the parent site map node.

  The for which to retrieve the parent site map node. 2.0.0.0
- Method
  System.Void `` To be added.

  Removes the specified object from all site map node collections that are tracked by the site map provider.

  The site map node to remove from the site map node collections. 2.0.0.0