System.Web.UI.WebControls.MenuItemBinding.Text Property

Gets or sets the text displayed for the menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied.

Syntax

[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Localizable(true)]
public string Text { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the System.Web.UI.WebControls.Menu control is bound to a data source, use the MenuItemBinding.Text property to specify the text to bind to the MenuItem.Text property of a System.Web.UI.WebControls.MenuItem object. This text is displayed in a menu item and is shared with all menu items to which the System.Web.UI.WebControls.MenuItemBinding object is applied.

Note:

You can override the text for an individual menu item by setting its MenuItem.Text property directly.

Instead of using this property to display the same text in each menu item, you can also bind the MenuItem.Text property of a System.Web.UI.WebControls.MenuItem object to a field of a data source by setting the MenuItemBinding.TextField property. When rendered, the MenuItem.Text property of each menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied contains the corresponding value from the field.

Note:

If the MenuItemBinding.Text and MenuItemBinding.TextField properties are both set, the MenuItemBinding.TextField property takes precedence.

You cannot create empty nodes in a System.Web.UI.WebControls.Menu control by setting the MenuItemBinding.Text or MenuItemBinding.TextField properties to the empty string (""). Setting these properties to the empty string has the same effect as not setting the properties. In that case, the System.Web.UI.WebControls.Menu control creates a default binding using the BaseDataBoundControl.DataSource property. For more information, see Accessing Data with ASP.NET.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see System.ComponentModel.LocalizableAttribute and ASP.NET Globalization and Localization.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0