Export (0) Print
Expand All

MenuItemBinding.TargetField Property

Gets or sets the name of the field from the data source to bind to the Target property of a MenuItem object to which the MenuItemBinding object is applied.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[TypeConverterAttribute("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string TargetField { get; set; }

Property Value

Type: System.String
The name of the field to bind to the Target of a MenuItem to which the MenuItemBinding is applied. The default is an empty string (""), which indicates that this property is not set.

When the Menu control is bound to a data source, use the TargetField property to specify the name of the field to bind to the MenuItem.Target property of a MenuItem object.

The MenuItem.Target property specifies the window or frame in which to display the Web content linked to a menu item when that menu item is clicked. Values must begin with a letter in the range of A through Z (case-insensitive), except for certain special values that begin with an underscore, as shown in the following table.

Target value

Description

_blank

Renders the content in a new window without frames.

_parent

Renders the content in the immediate frameset parent.

_self

Renders the content in the frame with focus.

_top

Renders the content in the full window without frames.

NoteNote

The Target property renders as a target attribute. The target attribute on anchor elements is not allowed in the XHTML 1.1 document type definition. Do not set the Target property if the rendered output for the MenuItemBinding must be XHTML 1.1 compliant. For more information, refer to the topic XHTML Standards in Visual Studio and ASP.NET.

When creating accessible Web pages, it is strongly recommended you avoid using the Target property to target another window. For more information, see ASP.NET Accessibility.

Note that setting this property overrides the Menu.Target property of the Menu control for this menu item. Setting the Menu.Target property to open a new window can make it difficult for users of assistive technology devices to use the page.

NoteNote

You can override enabling an individual menu item by setting its MenuItem.Target property directly.

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

NoteNote

If the Target and TargetField properties are both set, the TargetField property takes precedence.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft