This documentation is archived and is not being maintained.

MenuItem::Depth Property

Gets the level at which a menu item is displayed.

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

[BrowsableAttribute(false)]
public:
property int Depth {
	int get ();
}

Property Value

Type: System::Int32
The level at which a menu item is displayed.

Use the Depth property to determine the depth of the menu item. The depth indicates the level at which a menu item is displayed and represents the number of levels of hierarchy between the current menu item and the root menu item. For example, a root menu item has a depth of 0. A submenu item of the root menu item has a depth of 1, and so on.

The following example demonstrates how to use the Depth property to determine the depth of a menu item.

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

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: