XmlSiteMapProvider.AddProvider Method

Note: This method is new in the .NET Framework version 2.0.

Links a child site map provider to the current provider.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

protected virtual void AddProvider (
	string providerName,
	SiteMapNode parentNode
protected void AddProvider (
	String providerName, 
	SiteMapNode parentNode
protected function AddProvider (
	providerName : String, 
	parentNode : SiteMapNode



The name of one of the SiteMapProvider objects currently registered in the Providers.


A site map node of the current site map provider under which the root node and all nodes of the child provider is added.

Exception typeCondition


parentNode is a null reference (Nothing in Visual Basic).


providerName cannot be resolved.


The site map file used by providerName is already in use within the provider hierarchy.


The root node returned by providerName is a null reference (Nothing in Visual Basic).


The root node returned by providerName has a URL or key that is already registered with the parent XmlSiteMapProvider.

The AddProvider method links providerName to the current provider as a child of the current provider. The root node of providerName is added to the hierarchy for the current provider as a child node of parentNode. Because the parent provider calls the BuildSiteMap method on providerName, the exceptions that are described in the BuildSiteMap method might be thrown.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions