Menu::SelectedItem Property

 

Gets the selected menu item.

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

public:
[BrowsableAttribute(false)]
property MenuItem^ SelectedItem {
	MenuItem^ get();
}

Property Value

Type: System.Web.UI.WebControls::MenuItem^

A MenuItem that represents the selected menu item.

Use the SelectedItem property to determine the menu item selected by the user.

System_CAPS_noteNote

As a shortcut, you can also determine the text of the selected menu item directly by using the SelectedValue property.

When the user selects a menu item from a Menu control, the MenuItemClick event is raised, which allows you to perform a custom routine by providing an event handler.

The following code example demonstrates how to use the SelectedItem property to determine the selected menu item in a Menu control.

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

.NET Framework
Available since 2.0
Return to top
Show: