This documentation is archived and is not being maintained.

SiteMap::CurrentNode Property

Gets a SiteMapNode control that represents the currently requested page.

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

public:
static property SiteMapNode^ CurrentNode {
	SiteMapNode^ get ();
}

Property Value

Type: System.Web::SiteMapNode
A SiteMapNode instance that represents the currently requested page; otherwise, nullptr, if no representative node exists in the site map information.

ExceptionCondition
InvalidOperationException

The site map feature is not enabled.

ConfigurationErrorsException

The default provider specified in the configuration does not exist.

HttpException

The feature is supported only when running in Low trust or higher.

The SiteMap class retrieves the CurrentNode property by requesting it from the provider.

If no representative node exists for the page in the site map information, or if security trimming is enabled and the node cannot be returned for the current user, nullptr is returned.

The SiteMapResolve event is raised by the default site map provider if one or more subscriptions exist.

If you implement your own SiteMapProvider object, you might create your own mechanism to find and retrieve the CurrentNode. However, if you extend the StaticSiteMapProvider class and use a URL-based scheme to identify pages, you can override the FindSiteMapNode method.

The following code example demonstrates how to use the CurrentNode property to retrieve the SiteMapNode object that represents the current page.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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