The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientHtmlEditor.CommandExecuted Event

Occurs after a default or custom command has been executed on the client side.


CommandExecuted: ASPxClientEvent<ASPxClientHtmlEditorCommandEventHandler<ASPxClientHtmlEditor>>

Event Data

The CommandExecuted event handler receives an argument of the ASPxClientHtmlEditorCommandEventArgs type. The following properties provide information specific to this event.

Property Description
commandName Gets the name of the processed command.
parameter Gets an optional parameter that complements the processed command.


Handle the CommandExecuted event to perform specific client actions after a command has been executed within the ASPxHtmlEditor. You can, for instance, save the editor's modified content to a specific location by handling this event.


ASPxHtmlEditor allows you to provide custom toolbar buttons and modify the functionality of default buttons.

In this example, two custom buttons and corresponding shortcuts are created: Clear and Add Signature. When a button is clicked or shortcut is pressed, the ASPxClientHtmlEditor.CustomCommand event is triggered. In the event handler, the default select all and delete commands are executed using the ASPxClientHtmlEditor.ExecuteCommand method.

Additionally, we have modified the functionality of the default insert ordered list command. In the ASPxClientHtmlEditor.CommandExecuted event handler, which is triggered after the command is processed, we change the type of ordered list markers to Roman numerals.

    <script type="text/javascript">
    var MailSignature = '<p>Thanks,</p><p> Max Bing</p>';
    function onCustomCommand(commandName) {
        switch (commandName) {
            case ('clear'):
                HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.SELECT_ALL, null);
                HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.DELETE_COMMAND, null);
            case ('addSignature'):
                var HtmlWithSignature = HtmlEditor.GetHtml() + MailSignature;
    function onCommandExecuted(e) {
        if (e.commandName == 'insertorderedlist') {
            var html = HtmlEditor.GetHtml();
            html = html.replace(/<ol>/g, "<ol type='I'>");

    <dx:ASPxHtmlEditor ID="DemoHtmlEditor" ClientInstanceName="HtmlEditor" runat="server">
                    <dx:ToolbarBoldButton BeginGroup="True">
                    <dx:ToolbarInsertOrderedListButton BeginGroup="True">
                    <dx:CustomToolbarButton CommandName="addSignature" Text="Add Signature" ToolTip="Add Signature">
                    <dx:CustomToolbarButton CommandName="clear" Text="Clear" ToolTip="Clear">
            <dx:HtmlEditorShortcut ActionName="addSignature" ActionType="ExecuteCommand" Shortcut="Ctrl+Shift+I" />
            <dx:HtmlEditorShortcut ActionName="clear" ActionType="ExecuteCommand" Shortcut="Ctrl+Shift+D" />
        <ClientSideEvents CommandExecuted="function(s, e) { onCommandExecuted(e); }"
            CustomCommand="function(s, e) { onCustomCommand(e.commandName); }">
See Also