asp.net.ph

MenuItem.Text Property

System.Web.UI.WebControls Namespace   MenuItem Class


.NET Framework version 2.0

Sets or retrieves the text displayed for a MenuItem in a Menu control.

Syntax


Inline <asp:menuitem text = strtext ... >
Script MenuItem.Text [ = strtext ]

Property Value


strtext String that specifies the text displayed for a menu item in a Menu control.

The property is read/write with no default value.

Remarks

Use the Text property to specify or determine the text to display for a MenuItem in a Menu control.

In certain cases, such as when a Menu control is bound to a data source, the Text property is usually obtained dynamically from the data source.

Example

The following example shows how to declaratively set the Text property of menu items at design time.

 Show me 

The following example shows how to programmatically set the Text property of menu items at run time.

 Show me 

The following example demonstrates how to programmatically determine the given Text for a menu item and its parent, when the user selects an item from a Menu control.

Note that this example merely serves to illustrate the concept. If all you need is to determine the selected menu item's Text, simply use the SelectedItem.Text property to accomplish the same, without having to code a handler for the MenuItemClick event.

 Show me 

See Also

MenuItem Members   Value   SelectedValue 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