Skip to main content

constructor(htmlEditor, elementToReplace) Constructor

Initializes a new instance of the ASPxClientHtmlEditorInsertImageCommandArguments class.

Declaration

constructor(
    htmlEditor: ASPxClientHtmlEditor,
    elementToReplace: any
)

Parameters

Name Type Description
htmlEditor ASPxClientHtmlEditor

An HTML editor in which you want to insert an element.

elementToReplace any

An object containing the currently selected element in the HTML editor. This element will be replaced with the inserted image.

Remarks

// 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);
See Also