Επεξεργασία

Κοινή χρήση μέσω


MenuItemBinding.TargetField Property

Definition

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.

public:
 property System::String ^ TargetField { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string TargetField { get; set; }
[System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string TargetField { get; set; }
[<System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.TargetField : string with get, set
[<System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.TargetField : string with get, set
Public Property TargetField As String

Property Value

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.

Attributes

Remarks

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.

Note

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.

Note

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.

Note

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

Applies to

See also