Skip to main content
A newer version of this page is available. .
Tab

ASPxMenuBase.LinkStyle Property

Gets an object that contains style settings to be applied to links in a menu control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

public virtual LinkStyle LinkStyle { get; }

Property Value

Type Description
LinkStyle

A LinkStyle object that contains the style settings of links.

Remarks

A menu control can display its menu items as hyperlinks if their MenuItem.NavigateUrl property is specified.

The LinkStyle property provides access to the style settings that define the appearance of all links within a menu control. Using the settings available via the LinkStyle property, you can specify the style for normal, hovered and visited states of links.

Example

This part of the ItemLinkMode demo illustrates how to use the ASPxMenu‘s ItemLinkMode property.

Here, two ASPxMenu controls are used with different settings for their ItemLinkMode property. The first menu’s ItemLinkMode property is set by default to ContentBounds allowing the entire area of each menu item to be clickable. The ItemLinkMode property of the second menu is set to TextOnly.

...
<dxm:ASPxMenu id="ASPxMenu1" runat="server" AllowSelectItem="True" ShowPopOutImages="True">
    <Items>
        <dxm:MenuItem Name="home" Text="Home"></dxm:MenuItem>
        <dxm:MenuItem Name="products" Text="Products">
            <Items>
            ...
            </Items>
        </dxm:MenuItem>
        <dxm:MenuItem Name="downloads" Text="Downloads"></dxm:MenuItem>
        <dxm:MenuItem Name="support" Text="Support"></dxm:MenuItem>
    </Items> 
</dxm:ASPxMenu>
...
<dxm:ASPxMenu id="ASPxMenu2" SkinID="None" runat="server" AutoSeparators="RootOnly" 
ItemLinkMode="TextOnly" Font-Names="Tahoma" Font-Size="11px" 
Font-Underline="False" ForeColor="#162436" SeparatorColor="#5386CB" SeparatorHeight="10px">
    <Items>
    ...
    </Items>
    <Paddings Padding="0px" />
    <SeparatorPaddings PaddingLeft="14px" PaddingRight="14px" PaddingTop="1px" />
    <LinkStyle>
        <HoverFont Underline="True" />
    </LinkStyle>
</dxm:ASPxMenu>
...
See Also