ImageGear .NET - Updated
Removing a Context Menu Item from Top Level of Context Menu
User Guide > How to Work with... > Common Operations > Viewing > Viewing Using ASP.NET > [Legacy] Displaying Images Using Legacy ASP.NET > Context Menu Customization > Removing a Context Menu Item from Top Level of Context Menu

You can remove context menu items from a menu. The following example shows how to remove context menu items from the top level of a context menu.

For Ajax server users, please comment out the first portion of the code below and uncomment the second.

Example
Copy Code
// get PageView control with "pluginPageView" identifier from the HTML page in jQuery plugin
var pageView = $("#pluginPageView").ImGearPageViewPlugin();
// get PageView control with "pluginPageView" identifier from the HTML page for Ajax server
//var pageView = $.find("pluginPageView");
// get default context menu for image
var contextMenu = pageView.getDefaultContextMenu(null);
// remove two items from the top level
contextMenu.remove(0);
contextMenu.remove(0);
// set the renew context menu for RectangleZoom mouse tool
pageView.setContextMenuForTool(contextMenu, null, ImageGear.Web.UI.MouseTool.RectangleZoom);