Tab
A newer version of this page is available. Switch to the current version.

MenuItemCollection.Add(String, String, String, String) Method

Adds a new menu item to the collection and specifies the item's display text, name, associated image and URL.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public MenuItem Add(
    string text,
    string name,
    string imageUrl,
    string navigateUrl
)
Public Function Add(
    text As String,
    name As String,
    imageUrl As String,
    navigateUrl As String
) As MenuItem

Parameters

Name Type Description
text String

A String value specifying the menu item's display text. Initializes the menu item's MenuItem.Text property.

name String

A String value specifying the name which indentifies the created item. Initializes the item's MenuItem.Name property.

imageUrl String

A String value specifying the path to the image displayed by the item. Initializes the ImagePropertiesBase.Url property of the item's MenuItem.Image.

navigateUrl String

A String value specifying the URL to which the browser navigates when the item's text or associated image is clicked. Initializes the item's MenuItem.NavigateUrl property.

Returns

Type Description
MenuItem

A MenuItem object representing the newly created menu item.

Remarks

Use the Add method to add a new menu item with the specified settings to the MenuItemCollection object.

See Also