MenuItemBinding.TargetField 属性
定义
获取或设置数据源中字段的名称,该字段将绑定到 Target 对象将应用到的 MenuItem 对象的 MenuItemBinding 属性。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
属性值
绑定到应用 Target 的 MenuItem 的 MenuItemBinding 的字段的名称。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.
- 属性
注解
将 Menu 控件绑定到数据源时,请使用 TargetField 属性指定要绑定到对象的属性的字段名称 MenuItem.Target MenuItem 。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.
MenuItem.Target属性指定在单击菜单项时显示链接到菜单项的 Web 内容的窗口或框架。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. 值必须以 A 到 Z 范围内的字母(不区分大小写)打头,但某些以下划线打头的特殊值除外,如下表所示: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. |
备注
Target属性呈现为 target 属性。The Target property renders as a target attribute. target anchor XHTML 1.1 文档类型定义中不允许使用元素的属性。The target attribute on anchor elements is not allowed in the XHTML 1.1 document type definition. Target如果的呈现输出 MenuItemBinding 必须符合 XHTML 1.1,请不要设置属性。Do not set the Target property if the rendered output for the MenuItemBinding must be XHTML 1.1 compliant. 有关详细信息,请参阅Visual Studio 中的 XHTML 标准和 ASP.NET。For more information, refer to the topic XHTML Standards in Visual Studio and ASP.NET.
创建可访问的网页时,强烈建议你避免使用 Target 属性来面向其他窗口。When creating accessible Web pages, it is strongly recommended you avoid using the Target property to target another window. 有关详细信息,请参阅ASP.NET 辅助功能。For more information, see ASP.NET Accessibility.
请注意,设置此属性将覆盖 Menu.Target Menu 此菜单项的控件的属性。Note that setting this property overrides the Menu.Target property of the Menu control for this menu item. 将 Menu.Target 属性设置为打开新窗口可能会使辅助技术设备的用户难以使用页面。Setting the Menu.Target property to open a new window can make it difficult for users of assistive technology devices to use the page.
备注
您可以通过直接设置菜单项的属性来重写启用单个菜单项 MenuItem.Target 。You can override enabling an individual menu item by setting its MenuItem.Target property directly.
如果数据源包含多个表或属性,则必须先通过设置 Depth 属性和/或属性来建立绑定条件 DataMember 。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.
备注
如果 Target TargetField 同时设置了和属性,则 TargetField 属性优先。If the Target and TargetField properties are both set, the TargetField property takes precedence.