ASP.NET HTML Editor - Custom Context Menu support

In ContextMenuItem tag (See Custom Context Menu) are used two properties: MainFunction and CheckFunction. These properties contain names of custom defined functions for HTML Editor's Context Menu processor. The first function should do some execution on node for which the Context Menu was activated. The second function is used for enabled status definition. When the function returns true, this item will be enabled in the context menu. When the function returns false, this item will be disabled in the context menu.
Both functions have two paremeters: HTML Editor object and node for which the Context Menu was activated.

Custom defined Context Menu Item example.

<ed:ContextMenuItem TagName="Table" Title="Remove Shadow" MainFunction="myRemoveShadow" CheckFunction="myRemoveShadowCheck" />

JavaScript functions example.

// Remove Shadow table(wrapper) for the source table
function myRemoveShadow(editor,tableNode)
 // Get Editor's content document
 var doc = editor.getDocument();

 // Get the attached (Shadow) table ID
 var shadowId = tableNode.getAttribute(editor.attachedIdAttributeName());

 // Get it's node
 var shadowNode = doc.getElementById(shadowId);

 if(shadowNode != null)
   // Insert source table before it's shadow

   // Remove the shadow table

   // remove "attachedId" attribute from the source table

// Checks: can be removed Shadow table(wrapper) for the source table
function myRemoveShadowCheck(editor,tableNode)
 // Is there attached "Shadow Table" to this Table?
 if(tableNode.getAttribute(editor.attachedIdAttributeName()) &&
    tableNode.getAttribute(editor.attachedIdAttributeName()).length > 0)

   return true; // attached already
   return false;  // not yet

See CustomCM.aspx example in downloaded zip file. Home
HTML Editor Home
HTML Editor Home
Why the best?
Site Map
Examples - 80
Appearance - 10
Full button set
Lite button set
Custom button set
Design-mode textbox
How to fit into small space
Page maker
Default font
Initially without toolbar
Preview mode
"Read only" mode New
Content - 16
Read-only and custom tags
Shadow for Image
External image gallery
Upload images
Copy/paste formatting
Preview Document appearance
Keys used for editing
.NET validation
Documents Generator
Upload documents
Convert to PDF
Editor and database
Spell Checker - 3
Spell checking
Spell Checker dictionaries
Several dictionaries
Localization - 2
RTL support
Integration - 9
Inside Flyout
Inside Grid
Inside Window
With Color PickerNew
Google AJAX Language API New
Inside AJAX Page
Inside CallbackPanel
ASP.NET AJAX ControlToolkit - 5
Collapsible panel
Editor in each TabPanel New
Modal popup
Server-Side API - 13
Content counters
Plain text length control
Show plain text
Enable editor on focus
Set caret position on load
Add CSS files New
Hide HTML Editor until needed
CSS file for quick format
Set HTML view on load
Enable browse button for images
Enable browse button for URLs
Disable Wait message New
Server-Side Events - 5
ClickSubmit event
ClickCancel event
ContentChanged event
Client-Side API - 10
Working with selected text
Set design/HTML view on load
Show/hide HTML Editor
Get/set content
Surround HTML
Insert HTML
Style selected content
Exec command
Query command
'Not Set' in dropdowns New
Customize - 17
Custom editor toolbar in VS
Custom fonts
Custom font sizes
How to add icons
Custom Popup Windows
Custom Buttons
Custom Context Menu
Popup Properties Disabling
Default Table Properties
Custom toggle button
Custom select button
Textarea popup
Custom 'Quote' button New
Show/hide submit button
Show/hide Design/HTML view
Show/hide quick format panel
Width & Height
Knowledge Base - 1
Knowledge Base
Documentation - 23
Server side
HTML Editor properties & events
HTML Editor inner properties
Custom toolbar
Custom fonts
Custom font sizes
Custom Context Menu
Dictionaries for spell checker
Hot keys definition
Disabling Context Menu items
Additional CSS files New
Client side
Main functions and interfaces
Custom Context Menu support
Custom Popup Window support
Top toolbar buttons' methods
State functions
Suppress Context Menu
Spelling dictionary
Dictionary structure
Affix rules
Phonetic rules
Generate phonetic code
How to add new word
Supported browsers
Tutorials - 6
Using the correct path
Autosave implementation
Full custom buttons set
Editor_data for several sites
Use with database
Template XML file use New