System.Web.UI.WebControls.MenuItemBinding.ValueField Property

Gets or sets the name of the field from the data source to bind to the MenuItem.Value property of a System.Web.UI.WebControls.MenuItem object to which the System.Web.UI.WebControls.MenuItemBinding object is applied.

Syntax

[System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DefaultValue("")]
public string ValueField { 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.ValueField property to specify the name of the field to bind to the MenuItem.Value property of a System.Web.UI.WebControls.MenuItem object. When rendered, the MenuItem.Value property of each menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied contains the corresponding value from the field. The specified value is not displayed in a menu item and is used to store any additional data about a menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied, such as data used for handling postback events.

Note:

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

If the data source contains multiple tables or attributes, you must first establish the binding criteria by setting the MenuItemBinding.Depth property, the MenuItemBinding.DataMember property, or both.

Instead of using this property to bind the MenuItem.Value property of a System.Web.UI.WebControls.MenuItem object to a field, you can also bind it to a static value by setting the MenuItemBinding.Value property. This allows you to specify the same value for each menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied.

Note:

If the MenuItemBinding.Value and MenuItemBinding.ValueField properties are both set, the MenuItemBinding.ValueField property takes precedence.

Requirements

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