XmlSiteMapProvider::AddProvider Method
Links a child site map provider to the current provider.
Assembly: System.Web (in System.Web.dll)
Parameters
- providerName
- Type: System::String
The name of one of the SiteMapProvider objects currently registered in the Providers.
- parentNode
- Type: System.Web::SiteMapNode
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 | Condition |
|---|---|
| ArgumentException | The Provider property of the parentNode does not reference the current provider. |
| ArgumentNullException | parentNode is nullptr. |
| ProviderException | providerName cannot be resolved. |
| InvalidOperationException | The site map file used by providerName is already in use within the provider hierarchy. -or- The root node returned by providerName is nullptr. -or- 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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.