This documentation is archived and is not being maintained.

SiteMapPath::OnItemCreated Method

Raises the ItemCreated event of the SiteMapPath control.

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

protected:
virtual void OnItemCreated(
	SiteMapNodeItemEventArgs^ e
)

The ItemCreated event is raised after the SiteMapPath control creates a SiteMapNodeItem, which is a Web server control that represents a SiteMapNode, and associates it to a SiteMapNode. The OnItemCreated method is called before the created node item is bound to its data. This allows you to provide an event-handling method that performs a custom routine whenever a SiteMapNodeItem is created.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The OnItemCreated method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnItemCreated in a derived class, be sure to call the base class's OnItemCreated method so that registered delegates receive the event.

The following code example demonstrates how to call the OnItemCreated method after creating a SiteMapNodeItem within the InitializeItem method. This code example is part of a larger example provided for the SiteMapPath class.

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: