asp.net.ph

Menu.SelectedItem Property

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.

Syntax


Script [ MenuItem menu item = ] Menu.SelectedItem

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


menu item A MenuItem object that represents the selected menu item in a Menu control.

The property is read only with no default value.

Remarks

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 ).

Example

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

 Show me 

See Also

Menu Members   SelectedValue   Text   Value Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph