ToolBarMenuButton.AddMenuItem Method (String, String, String, String, String, String, SPBasePermissions, PermissionContext)

Adds a menu item with the specified identifier, display name, URL, description, navigate URL, on-click script, required permissions, and context.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Overridable Function AddMenuItem ( _
    id As String, _
    displayName As String, _
    imageUrl As String, _
    description As String, _
    navigateUrl As String, _
    onClickScript As String, _
    permissions As SPBasePermissions, _
    context As PermissionContext _
) As MenuItemTemplate
'Usage
Dim instance As ToolBarMenuButton
Dim id As String
Dim displayName As String
Dim imageUrl As String
Dim description As String
Dim navigateUrl As String
Dim onClickScript As String
Dim permissions As SPBasePermissions
Dim context As PermissionContext
Dim returnValue As MenuItemTemplate

returnValue = instance.AddMenuItem(id, _
    displayName, imageUrl, description, _
    navigateUrl, onClickScript, permissions, _
    context)
public virtual MenuItemTemplate AddMenuItem(
    string id,
    string displayName,
    string imageUrl,
    string description,
    string navigateUrl,
    string onClickScript,
    SPBasePermissions permissions,
    PermissionContext context
)

Parameters

  • displayName
    Type: System.String

    The name displayed in the UI for the menu item.

  • imageUrl
    Type: System.String

    The URL of the image displayed for the menu item.

  • description
    Type: System.String

    The description of the menu item.

  • navigateUrl
    Type: System.String

    The URL to navigate to when the menu item is selected.

  • onClickScript
    Type: System.String

    The script that runs when the button is selected.

Return Value

Type: Microsoft.SharePoint.WebControls.MenuItemTemplate
The menu item.

See Also

Reference

ToolBarMenuButton Class

ToolBarMenuButton Members

AddMenuItem Overload

Microsoft.SharePoint.WebControls Namespace