asp.net.ph

Menu.SelectedValue Property

System.Web.UI.WebControls Namespace   Menu Class


.NET Framework version 2.0

Returns the value of the selected menu item in a Menu control.

Syntax


Script [ String strValue = ] Menu.SelectedValue

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

Property Value


strValue The value of the selected menu item in a Menu control.

The property is read only with no default value.

Remarks

Use the SelectedValue property to determine the value of the selected menu item in a Menu control.

This property simply returns the value of the Value property of the MenuItem object that is referred to by the SelectedItem property ( SelectedItem.Value ).

If no Value is specified for the menu item, this property returns the value of the selected menu item's Text property. If the Text property in turn contains a null reference, or if no menu item is currently selected in the Menu control, an empty string ( "" ) is returned.

To access other properties of the selected menu item, though, such as Parent or Depth, you still need to use the SelectedItem property.

Example

The following example demonstrates how to use the SelectedValue property to determine the value of the selected menu item in a Menu control.

 Show me 

See Also

Menu Members   SelectedItem   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