SiteMapPath::OnItemCreated Method (SiteMapNodeItemEventArgs^)

 

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 NIB: 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
Available since 2.0
Return to top
Show: