ASPxClientCommandConsts.INSERTIMAGE_COMMAND Property

Identifies a command that inserts a new image.

Declaration

static INSERTIMAGE_COMMAND: string

Property Value

Type Description
string

Value: "insertimage"

Remarks

The INSERTIMAGE_COMMAND property can be used in the followng ways.

  • In the ASPxClientHtmlEditor.CommandExecuted event — to determine the action performed by an end-user. If the ASPxClientHtmlEditorCommandEventArgs.commandName event parameter returns the INSERTIMAGE_COMMAND property value, this means that an end-user has clicked the OK button within the Insert Image dialog.
  • In the ASPxClientHtmlEditor.ExecuteCommand method — to execute the command manually.

    In this case, the method requires an additional parameter, which is an object of the ASPxClientHtmlEditorInsertImageCommandArguments type.

    
    // Inserting a new image instead of the "myDiv" div
    var myDiv = htmlEditor.GetDesignViewDocument().getElementById("myDiv");
    var args = new ASPxClientHtmlEditorInsertImageCommandArguments(htmlEditor, myDiv);
    args.align = "center";
    args.alt = "Some alternate text";
    args.src = "/Content/SampleImage.png";
    args.styleSettings.width = "400px";
    args.useFloat = true;
    htmlEditor.ExecuteCommand(ASPxClientCommandConsts.INSERTIMAGE_COMMAND, args);
    
Note

This command is available only in the Design View.

See Also