System.Web 2.0.0.0 System.Configuration.Provider.ProviderBase

The and classes represent the default implementations of the abstract class. The uses an XML file named Web.sitemap to store site map data. For more information on about the Web.sitemap file, see ASP.NET Site Maps.

The class supports the concept of a site map provider hierarchy, by declaring the and properties. A can be a child or parent of another provider. This enables scenarios where different content areas of a site are owned or implemented by different development groups that maintain their own site maps and site map providers.

All objects are configured in the Web.config files. Any site map providers that are declared in these configuration files are loaded at run time and are used to load and process site navigation data. The object, which keeps track of all the providers that are available to it through its property collection, provides programmatic access to the navigation data that is managed by the providers. The following code example demonstrates the format that is used to declare a site map provider in a Web.config file.

`<siteMap defaultProvider="<name>"> <providers> <add name="<friendly name>" type="<fully qualified class name>, <assembly name (optional)>" siteMapFile = "<file name>" /> </providers> </siteMap>`

The site navigation data that is loaded by these providers is used by other components of the site map infrastructure, such as the and controls, to display site map information for users.

If you implement your own site map provider, you can place the source file in the App_Code directory of your ASP.NET application, and then the assembly will be compiled automatically. You can also place your own site map provider in the Global Assembly Cache (GAC), and provide a fully-qualified reference to it in the Web.config file. For more information on compiler services, see Working with Assemblies and the Global Assembly Cache.

Provides a common base class for all site map data providers, and a way for developers to implement custom site map data providers that can be used with the ASP.NET site map infrastructure as persistent stores for objects.

- Constructor

  The class is not instantiated directly. The 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
  System.Void ``

  Classes deriving from the class can override the method and provide logic for adding a object to the node collection that is maintained by the site map provider. The default implementation of the method throws a exception.

  Adds a object to the node collection that is maintained by the site map provider.

  The to add to the node collection maintained by the provider. 2.0.0.0
- Method
  2.0.0.0
  System.Void `` ``

  Classes deriving from the class can override the method and provide logic for adding a object with a specified parent to the node collection that is maintained by the site map provider. For example, the method adds the object that is specified by to the collection that is maintained by the object and creates a parent/child relationship between the object that is specified by and . The default implementation of the method throws a exception.

  Adds a object to the node collection that is maintained by the site map provider and specifies the parent object.

  The to add to the node collection maintained by the provider. The that is the parent of .
- Property
  System.Web.SiteMapNode To be added.

  The event is raised before attempting to retrieve a object, to enable event subscribers to return an instance of the class. If there are no event subscribers, the class calls the method using the current HTTP context to retrieve a that represents the currently requested page.

  If the currently requested page does not correspond with a , null is returned. If security trimming is enabled and the user is not permitted to access the , null is returned.

  Gets the object that represents the currently requested page.

  2.0.0.0
- Property
  System.Boolean To be added.

  The property is used for the get accessor of the and properties, as well as additional properties of a object.

  Gets or sets a Boolean value indicating whether localized values of attributes are returned.

  2.0.0.0
- Method
  System.Web.SiteMapNode ``

  Classes that derive from the class must implement the abstract method.

  The URL provided can be a virtual or absolute URL. It might also be a URL that uses application-relative syntax, such as ~/apprelativedirectory. Ensure that any implementation of the method parse and handle application-relative syntax properly.

  The class, which is the default site map provider for ASP.NET, uses the URL of a object as a key in the various collections that the classes maintain. Therefore, if a provides a URL, it must be unique within the scope of the site map provider. If no URL is provided, a unique identifier is generated to identify the .

  When overridden in a derived class, retrieves a object that represents the page at the specified URL.

  A that represents the page identified by ; otherwise, null, if no corresponding is found or if security trimming is enabled and the cannot be returned for the current user.

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

  The method calls the abstract method to retrieve a object for the currently requested page based on the raw URL or the virtual path of the request. If no corresponding is found in the , null is returned.

  The method does not check whether a is accessible to a user, by default.

  Retrieves a object that represents the currently requested page using the specified object.

  A that represents the currently requested page; otherwise, null, if no corresponding can be found in the or if the page context is null.

  The used to match node information with the URL of the requested page. 2.0.0.0
- Method
  System.Web.SiteMapNode ``

  The implementation returns null in all cases. Classes that derive from the class can override the method to provide lookup functionality based on a unique key (instead of a URL, which is used by the method). Implement the method if your site map provider implementation uses the property of a object as a primary identifier in a site map structure.

  The class provides an implementation that handles searching for site map nodes that do not define a URL.

  The class, which is the default site map provider for ASP.NET, uses the URL of a as a key in the various collections that the classes maintain. Therefore, if a node provides a URL, it must be unique within the scope of the site map provider. If no URL is provided, a unique identifier is generated to identify the .

  Retrieves a object based on a specified key.

  A that represents the page identified by ; otherwise, null, if no corresponding is found or if security trimming is enabled and the cannot be returned for the current user. The default is null.

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

  Classes that derive from the class must implement the abstract method.

  When overridden in a derived class, retrieves the child nodes of a specific .

  A read-only that contains the immediate child nodes of the specified ; otherwise, null or an empty collection, if no child nodes exist.

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

  The default implementation of the method returns the property; however, site map providers can override the method and provide an optimized implementation that uses custom caching mechanisms to return the current , as well as the parent and ancestor nodes of the parent.

  The parameter is used to specify how many levels of parent and ancestor nodes to retrieve. If preferred, the parent and ancestor nodes can be linked to the object that is returned by the method, using the property.

  The class, which is the default site map provider for ASP.NET, caches the entire site map in memory, which results in little or no overhead when querying the for specific objects.

  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.

  A that represents the currently requested page; otherwise, null, if the is not found or cannot be returned for the current user.

  The number of ancestor site map node generations to get. A value of -1 indicates that all ancestors might be retrieved and cached by the provider. 2.0.0.0
- Method
  System.Web.SiteMapNode `` ``

  The default implementation of the method returns the property; however, site map providers can override the method and provide an optimized implementation that uses custom caching mechanisms to return the current object, as well as objects that are in the proximity of the current .

  The parameter is used to specify how many levels of parent and ancestor nodes to retrieve and cache, along with their immediate children. The parameter is used to specify how many levels of descendant nodes from the current to retrieve. If preferred, the ancestor and descendant nodes can be linked to the that is returned by the

  method, using the and properties. If there are fewer ancestor or child node levels than are specified by or , only those that are available are retrieved.

  The class, which is the default site map provider for ASP.NET, caches the entire site map in memory, which results in little or no overhead when querying the for specific objects.

  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.

  A that represents the currently requested page; otherwise, null, if the is not found or cannot be returned for the current user.

  The number of ancestor generations to fetch. 0 indicates no ancestor nodes are retrieved and -1 indicates that all ancestors might be retrieved and cached by the provider. The number of child generations to fetch. 0 indicates no descendant nodes are retrieved and a -1 indicates that all descendant nodes might be retrieved and cached by the provider. 2.0.0.0
- Method
  System.Web.SiteMapNode `` To be added.

  When overridden in a derived class, retrieves the parent node of a specific object.

  A that represents the parent of ; otherwise, null, if the has no parent or security trimming is enabled and the parent node is not accessible to the current user.

  might also return null if the parent node belongs to a different provider. In this case, use the property of instead.

  The for which to retrieve the parent node. 2.0.0.0
- Method
  System.Web.SiteMapNode `` ``

  The default implementation of the class provides a non-optimized implementation of the method, calling the and methods; however, site map providers can override the method and provide an optimized implementation that uses custom caching mechanisms to return the ancestor node and perform an optimized lookup of the other objects.

  The parameter is used to specify how many levels of parent and ancestor nodes to traverse when retrieving the target node. If fewer levels exist than are requested, null is returned. The parameter is used to specify how many levels of descendant nodes from the target ancestor node to retrieve. If preferred, the ancestor and descendant nodes can be linked to the that is returned by the method, using the and properties.

  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.

  A that represents an ancestor of the currently requested page; otherwise, null, if the current or ancestor is not found or cannot be returned for the current user.

  The number of ancestor node levels to traverse when retrieving the requested ancestor node. The number of descendant node levels to retrieve from the target ancestor node. 2.0.0.0
- Method
  System.Web.SiteMapNode `` `` ``

  The default implementation of the class provides a non-optimized implementation of the method, calling the and methods; however, site map providers can override the method and provide an optimized implementation that uses custom caching mechanisms to return the ancestor node and perform an optimized lookup of the other objects. The method is very similar to the method.

  The parameter is used to specify how many levels of parent and ancestor nodes to traverse when retrieving the target node. If fewer levels exist than are requested, null is returned. The parameter is used to specify how many levels of descendant nodes from the target ancestor node to retrieve. If preferred, the ancestor and descendant nodes can be linked to the that is returned by the method, using the and properties. If there are fewer ancestor node levels than specified by the parameter, null is returned. It is up to the provider implementer to decide how to handle the situation where the number of available descendant node levels is less than the value that is specified by the parameter.

  Provides an optimized lookup method for site map providers when retrieving an ancestor node for the specified object and fetching its child nodes.

  A that represents an ancestor of ; otherwise, null, if the current or ancestor is not found or cannot be returned for the current user.

  The that acts as a reference point for and . The number of ancestor node levels to traverse when retrieving the requested ancestor node. The number of descendant node levels to retrieve from the target ancestor node. 2.0.0.0
- Method
  2.0.0.0
  System.Web.SiteMapNode

  The method enables a parent provider in a provider hierarchy to obtain a object that acts as a frame of reference for building the provider hierarchy and the larger site map node hierarchy that is the sum of the site map data that each provider manages.

  When overridden in a derived class, retrieves the root node of all the nodes that are currently managed by the current provider.

  A that represents the root node of the set of nodes that the current provider manages.

- Method
  System.Web.SiteMapNode ``

  The default implementation calls the abstract method on the specified .

  Retrieves the root node of all the nodes that are currently managed by the specified site map provider.

  A that represents the root node of the set of nodes that is managed by .

  The provider that calls the . 2.0.0.0
- Method
  System.Void `` ``

  The default method only checks for an parameter that is less than -1 and a parameter that is null. Because the class caches site map information in memory, the method is not used.

  Site map providers can override the method to perform an optimized retrieval of parent and ancestor nodes of the specified object.

  The parameter is used to specify how many levels of parent and ancestor nodes to traverse from the specified . If fewer levels exist than are requested, all available ancestor nodes are returned within the specified bound. If preferred, the parent node can be linked to the specified using the property.

  Provides a method that site map providers can override to perform an optimized retrieval of one or more levels of parent and ancestor nodes, relative to the specified object.

  The that acts as a reference point for . The number of ancestor generations to fetch. 0 indicates no ancestor nodes are retrieved and -1 indicates that all ancestors might be retrieved and cached. 2.0.0.0
- Method
  System.Void `` `` ``

  The default method only checks for an and parameters that are less than -1 and a parameter that is null. Because the object caches site map information in memory, the method is not used.

  Site map providers can override the method to perform an optimized lookup of the objects in the proximity of the specified . The parameter is used to specify how many levels of parent and ancestor nodes to traverse from the specified . The parameter is used to specify how many levels of child nodes from the current node to retrieve. If preferred, the ancestor and descendant nodes can be linked to the that is returned by the method, using the and properties.

  Provides a method that site map providers can override to perform an optimized retrieval of nodes found in the proximity of the specified node.

  The that acts as a reference point for . The number of ancestor generations to fetch. 0 indicates no ancestor nodes are retrieved and -1 indicates that all ancestors (and their descendant nodes to the level of ) might be retrieved and cached. The number of descendant generations to fetch. 0 indicates no descendant nodes are retrieved and -1 indicates that all descendant nodes might be retrieved and cached. 2.0.0.0
- Method
  System.Void `` ``

  The method does not actually build a site map, it only prepares the state of the object to do so. The default implementation initializes the property for the site map provider from the site navigation configuration.

  Classes that derive from the can override the method to initialize any state and resources that are required to load site map data from persistent storage. For example, if your derived class is using files to store site map data, any file initialization can be performed in the method. If the derived class uses some other type of data store, such as a relational database, initializing a database connection might be performed.

  Additional attributes, such as file names or connection strings, are read by the ASP.NET configuration system and passed to the method with its parameter.

  Initializes the implementation, including any resources that are needed to load site map data from persistent storage.

  The of the provider to initialize. A that can contain additional attributes to help initialize the provider. These attributes are read from the site map provider configuration in the Web.config file. 2.0.0.0
- Method
  System.Boolean `` ``

  The default behavior when security trimming is enabled is as described in the following table.

  Condition

  Return Value

  The exists on and the current user is in at least one of the specified roles.

  - or -

  The current thread has an associated WindowsIdentity that has file access to the requested URL and the URL is located within the directory structure for the application.

  - or -

  The current user is authorized specifically for the requested URL in the authorization element for the current application and the URL is located within the directory structure for the application.

  true

  None of the preceding conditions is met.

  false

  Retrieves a Boolean value indicating whether the specified object can be viewed by the user in the specified context.

  true if security trimming is enabled and can be viewed by the user or security trimming is not enabled; otherwise, false.

  The that contains user information. The that is requested by the user. 2.0.0.0
- Property
  System.Web.SiteMapProvider To be added.

  All classes that implement the abstract class can support the concept of a site map provider hierarchy. Any hierarchical relationships between providers are maintained outside the scope of a collection by the providers themselves. For an example of a functional provider hierarchy, see .

  Gets or sets the parent object of the current provider.

  2.0.0.0
- Method
  System.Void ``

  Classes deriving from the class can override the method and provide logic for removing objects from the node collection that is maintained by the site map provider. The default implementation of the method throws a exception.

  Removes the specified object from the node collection that is maintained by the site map provider.

  The to remove from the node collection maintained by the provider. 2.0.0.0
- Method
  System.Web.SiteMapNode ``

  The parameter and a reference to the provider that called the method are passed to the constructor of any associated object.

  Raises the event.

  A provided by the event handler delegate that is registered to handle the event or, if more than one delegate is registered to handle the event, the return value of the last delegate in the delegate chain; otherwise, null.

  The for which the site map currently exists. 2.0.0.0
- Property
  System.String To be added.

  The property is used with the method of the class. For the and properties, as well as any additional attributes that are defined in the collection of the object, the method takes precedence over the when the localization is enabled with the property set to true.

  Get or sets the resource key that is used for localizing attributes.

  2.0.0.0
- Property
  System.Web.SiteMapNode To be added.

  The default implementation calls the abstract method.

  Gets the root object of the site map data that the current provider represents.

  2.0.0.0
- Property
  System.Web.SiteMapProvider To be added.

  All classes that implement the class can support the concept of a site map provider hierarchy. Any hierarchical relationships between providers are maintained outside the scope of a collection by the providers themselves. For an example of a functional provider hierarchy, see .

  Gets the root object in the current provider hierarchy.

  2.0.0.0
- Property
  System.Boolean To be added.

  Security trimming cannot be set programmatically—it is set in the configuration for the provider.

  Gets a Boolean value indicating whether a site map provider filters site map nodes based on a user's role.

  2.0.0.0
- Event
  System.Web.SiteMapResolveEventHandler

  You can create a representation of the currently requested page without implementing a custom site map provider by subscribing to the event. Subscribers attach a object to receive notification when the property is called and can return a custom object instead of the default one that is returned by the property.

  For more information about handling events, see Consuming Events.

  Occurs when the property is called.

  2.0.0.0