DxMenuItem.Target Property
Specifies the target attribute’s value for the item.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
[DefaultValue(null)]
[Parameter]
public string Target { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
String | null | The |
#Remarks
Use the NavigateUrl property to specify a URL where the web browser navigates when the item is clicked. To specify where the browser should open the URL (in the current window, new tab, and so on), use the Target
property.
Refer to the MDN documentation for available property values: target. If you do not specify the Target
property value explicitly, the component applies the _self
value.
The DxMenu.Target property specifies the common target attribute’s value for all items in the Menu. To override the attribute value for a specific item, use the DxMenuItem.Target
property.
The following code snippet specifies link targets for menu items. The item Submit a ticket opens its link in a new tab. The rest of the items open their links in the same tab:
<DxMenu Title="DevExpress" Target="_self">
<Items>
<DxMenuItem Text="Home" NavigateUrl="https://www.devexpress.com" />
<DxMenuItem Text="Blazor Components" NavigateUrl="https://www.devexpress.com/blazor/" />
<DxMenuItem Text="Support">
<Items>
<DxMenuItem Text="Submit a ticket" NavigateUrl="https://supportcenter.devexpress.com/ticket/list" Target="_blank" />
</Items>
</DxMenuItem>
</Items>
</DxMenu>