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
id
Type: System.StringThe identifier of the menu item.
displayName
Type: System.StringThe name displayed in the UI for the menu item.
imageUrl
Type: System.StringThe URL of the image displayed for the menu item.
description
Type: System.StringThe description of the menu item.
navigateUrl
Type: System.StringThe URL to navigate to when the menu item is selected.
onClickScript
Type: System.StringThe script that runs when the button is selected.
permissions
Type: Microsoft.SharePoint.SPBasePermissionsThe permissions required for accessing the menu item.
context
Type: Microsoft.SharePoint.Utilities.PermissionContextThe context in which the menu item appears.
Return Value
Type: Microsoft.SharePoint.WebControls.MenuItemTemplate
The menu item.