Spread ASP.NET 15
Spread for ASP.NET 15 Product Documentation / Client-Side Scripting Reference / Scripting Members / Classes / ContextMenu
In This Topic
    In This Topic

    The ContextMenu class consists of the following members. You can use this class to disable a menu item on the client side.

    Constructor Description
    public ContextMenu(); Initializes a new instance of the ContextMenu class

    Property Description
    public Array Items {get;} Gets the MenuItem collection


    Method Description
    GetItem(name: string); Gets a menu item using text
    SetEnabled(enabled); Sets the menu item enabled state
    GetEnabled(); Gets the menu item enabled state
    GetText(); Gets the menu item text

    This is a sample that disables a menu item. On the client side, the script would look like this:

    Copy Code
    function onContextMenuOpening(event)
      var menu = event.ContextMenu;
      var copyItem = menu.GetItem("Copy");