SiteMapProvider::CurrentNode Property
Gets the SiteMapNode object that represents the currently requested page.
Assembly: System.Web (in System.Web.dll)
Property Value
Type: System.Web::SiteMapNodeA SiteMapNode that represents the currently requested page; otherwise, nullptr, if the SiteMapNode is not found or cannot be returned for the current user.
The SiteMapResolve event is raised before attempting to retrieve a SiteMapNode object, to enable event subscribers to return an instance of the SiteMapNode class. If there are no event subscribers, the SiteMapProvider class calls the FindSiteMapNode method using the current HTTP context to retrieve a SiteMapNode that represents the currently requested page.
If the currently requested page does not correspond with a SiteMapNode, nullptr is returned. If security trimming is enabled and the user is not permitted to access the SiteMapNode, nullptr is returned.
| Topic | Location |
|---|---|
| How to: Programmatically Modify Site-Map Nodes in Memory | Building ASP .NET Web Applications |
| How to: Programmatically Modify Site-Map Nodes in Memory | Building ASP .NET Web Applications |
The following code example demonstrates how to implement the CurrentNode property in a class that implements the abstract SiteMapProvider class.
This code example is part of a larger example provided for the SiteMapProvider class.
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.