다음을 통해 공유


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

Adds a menu item to the toolbar menu button with the specified identifier, display name, image URL, description, navigate URL, and script.

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 _
) 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 returnValue As MenuItemTemplate

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

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 menu button is selected.

Return Value

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

Remarks

There is no permission check for this menu item.

See Also

Reference

ToolBarMenuButton Class

ToolBarMenuButton Members

AddMenuItem Overload

Microsoft.SharePoint.WebControls Namespace