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

BootstrapClientMenu.GetItemByName(name) Method

Returns a menu item specified by its name.

Declaration

GetItemByName(
    name: string
): BootstrapClientMenuItem

Parameters

Name Type Description
name string

A string value specifying the name of the menu item.

Returns

Type Description
BootstrapClientMenuItem

A BootstrapClientMenuItem object that represents the menu item with the specified name.

Remarks

A menu control’s client-side functionality allows individual menu items to be accessed programmatically. The GetItemByName method gets a client menu item object specified by its name. A menu item’s name is defined by the MenuItem.Name property.

This method searches the specified menu item amongst all items contained by the menu control (throughout all menu levels). Note that if an invalid name is passed via the parameter, this method returns null.

In order to access a particular menu item’s subitem specified by its name, the menu item’s BootstrapClientMenuItem.GetItemByName method can be used.

See Also