System.Web.UI.WebControls Namespace Menu Class
.NET Framework version 2.0
Returns a MenuItem object that represents the selected menu item in a Menu control.
Script |
[ MenuItem menu item = ] Menu.SelectedItem |
This property can only be used programmatically; it cannot be set when declaring the control.
menu item |
A MenuItem object that represents the selected menu item in a Menu control. |
The property is read only with no default value.
Use the SelectedItem property to determine which menu item is selected in a Menu control.
The text of a menu item in a Menu control can be in one of two modes: selection mode and navigation mode. A menu item is in navigation mode when the NavigateUrl property for the menu item is set to a value other than an empty string. Otherwise, the menu item is in selection mode, wherein the user can select a menu item by clicking on the menu item text.
NOTE: When a MenuItem in a Menu control is in navigation mode, the SelectedItem property returns a null reference ( Nothing in Visual Basic ) when that menu item is selected ( clicked ).
The following example demonstrates how to use the SelectedItem property to determine which menu item is selected in a Menu control.
Show me
Menu Members SelectedValue Text Value