ImageGear .NET v25.2 - Updated
Creating Context Menu Items
Developer Guide > How to Work with... > Common Operations > Viewing > Viewing Using ASP.NET > [Legacy] Displaying Images Using Legacy ASP.NET > Context Menu Customization > Creating Context Menu Items

You can also add your own menu items. Additionally, the user specific menu items can be set to use checkboxes and radio buttons.

There are two ways to create a ContextMenuItem. You can do it explicitly or implicitly.

The explicit way assumes the use of the constructor and is a more formal way, requiring all members to be specified explicitly:

Example
Copy Code
var contextMenuItem = new ImageGear.Web.UI.ContextMenuItem
    (ImageGear.Web.UI.ContextMenuItemType.Popup, 'Some group of items',
    precreatedContextMenu, null, null, null);

The implicit way is less strict and is based on the Javascript object notation (JSON):

Example
Copy Code
 var contextMenuItem = {
     type: ImageGear.Web.UI.ContextMenuItemType.Popup,
     text: 'Some group of items',
     items: precreatedContextMenu
  };
Is this page helpful?
Yes No
Thanks for your feedback.