ASPxClientHtmlEditor.GetContextMenu Method
In This Article
Returns a collection of client context menu objects.
#Declaration
TypeScript
GetContextMenu(): ASPxClientPopupMenu
#Returns
Type | Description |
---|---|
ASPx |
An ASPx |
#Remarks
Use the GetContextMenu method on the client-side to access the collection of context menu objects. A particular menu object can be accessed by its name within the collection using the ASPxClientMenuBase.GetItemByName method.
#Example
The code sample below demonstrates how you can handle the ASPxClientHtmlEditor.ContextMenuShowing event to change the content of a context menu (by changing its items visibility).
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
MyHtmlEditor.ContextMenuItems.CreateDefaultItems();
MyHtmlEditor.ContextMenuItems.Insert(0, new HtmlEditorContextMenuItem("Add Title...", "AddTitle"));
MyHtmlEditor.ContextMenuItems.Insert(1, new HtmlEditorContextMenuItem("Change Title...", "ChangeTitle"));
MyHtmlEditor.ContextMenuItems.Insert(2, new HtmlEditorContextMenuItem("Remove Title", "RemoveTitle"));
}
}
See Also