New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI MenuItem TagHelper MenuItemTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("menu-item", ParentTag = "items", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("menu-item", ParentTag = "sub-items", TagStructure = TagStructure.NormalOrSelfClosing)]
[RestrictChildren("sub-items", new string[] { "content", "icon" })]
[OutputElementHint("li")]
public class MenuItemTagHelper : AnchorTagHelper, ITagHelper, ITagHelperComponent, INavigationItem

Inheritance: objectTagHelperAnchorTagHelperMenuItemTagHelper

Implements: INavigationItemITagHelperITagHelperComponent

Inherited Members AnchorTagHelper.Process(TagHelperContext, TagHelperOutput)AnchorTagHelper.OrderAnchorTagHelper.GeneratorAnchorTagHelper.ActionAnchorTagHelper.ControllerAnchorTagHelper.AreaAnchorTagHelper.PageAnchorTagHelper.PageHandlerAnchorTagHelper.ProtocolAnchorTagHelper.HostAnchorTagHelper.FragmentAnchorTagHelper.RouteAnchorTagHelper.RouteValuesAnchorTagHelper.ViewContextTagHelper.Init(TagHelperContext)object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-menu name="menu">
    <items>
        <menu-item text="Parent Item">
            <sub-items>
                <menu-item text="Child Item"></menu-item>
            </sub-items>
        </menu-item>
    </items>
</kendo-menu>

Constructors

MenuItemTagHelper method.

C#
public MenuItemTagHelper(IHtmlGenerator generator, IAuthorizationService authorizationService, IAuthorizationPolicyProvider policyProvider, IActionDescriptorCollectionProvider actionDescriptorCollection, IIconBuilder iconBuilder)
Parameters:generatorIHtmlGeneratorauthorizationServiceIAuthorizationServicepolicyProviderIAuthorizationPolicyProvideractionDescriptorCollectionIActionDescriptorCollectionProvidericonBuilderIIconBuilder

Properties

Specifies the actions content of the menu item, such as keyboard shortcuts.

C#
public string Actions { get; set; }

The collection of child items for the menu item.

C#
[HtmlAttributeNotBound]
public IEnumerable<MenuItemBase> Children { get; set; }

The content of the menu item.

C#
[HtmlAttributeNotBound]
public string Content { get; set; }

Implements: INavigationItem.Content

The HTML attributes for the content of the menu item.

C#
[HtmlAttributeNotBound]
public object ContentHtmlAttributes { get; set; }

Implements: INavigationItem.ContentHtmlAttributes

Specifies the description of the menu item.

C#
public string Description { get; set; }

Specifies whether the item is initially enabled

C#
public bool? Enabled { get; set; }

Implements: INavigationItem.Enabled

Specifies whether the item's text is encoded

C#
public bool? Encoded { get; set; }

Implements: INavigationItem.Encoded

If set to true, the item is rendered as a decorative, non-interactive group header instead of a regular selectable menu item.

C#
public bool? GroupHeader { get; set; }

Specifies the font icon displayed by the item. https://docs.telerik.com/kendo-ui/styles-and-layout/icons-web

C#
public string Icon { get; set; }

Implements: INavigationItem.Icon

Specifies custom class name for the icon displayed by the item

C#
public string IconClass { get; set; }

Implements: INavigationItem.IconClass

Specifies the icon position for the item.

C#
public IconPosition IconPosition { get; set; }

Specifies the HTML attributes of the image

C#
public object ImageHtmlAttributes { get; set; }

Implements: INavigationItem.ImageHtmlAttributes

Specifies the URL of the image displayed by the item

C#
public string ImageUrl { get; set; }

Implements: INavigationItem.ImageUrl

Specifies the HTML attributes of the link

C#
public object LinkHtmlAttributes { get; set; }

Implements: INavigationItem.LinkHtmlAttributes

Specifies whether the item is initially selected

C#
public bool? Selected { get; set; }

Implements: INavigationItem.Selected

Specifies whether the item is a separator

C#
public bool? Separator { get; set; }

Implements: INavigationItem.Separator

Specifies the text displayed by the item

C#
public string Text { get; set; }

Implements: INavigationItem.Text

Specifies the URL that the item links to

C#
public string Url { get; set; }

Implements: INavigationItem.Url

Specifies whether the item will be rendered

C#
public bool? Visible { get; set; }

Implements: INavigationItem.Visible

Methods

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelper.ProcessAsync(TagHelperContext, TagHelperOutput)