Skip to main content

ASPxClientHtmlEditor.CreateChangeMediaElementCommandArguments(element) Method

Creates a parameter for ASPxHtmlEditor‘s client-side commands related to changing media elements.


    element: any
): ASPxClientHtmlEditorChangeMediaElementCommandArguments


Name Type Description
element any

An element that is being changed.


Type Description

An ASPxClientHtmlEditorChangeMediaElementCommandArguments object which contains the current settings of the changed element.


When executed manually, ASPxHtmlEditor‘s client-side commands related to changing media elements (Audio, Video, Flash, etc.) require specific parameters. These parameters are descendants of the ASPxClientHtmlEditorChangeMediaElementCommandArguments class and don’t have public constructors. To create a parameter, pass the element you’re about to change as an element parameter to the CreateChangeMediaElementCommandArguments method. It creates an object containing properties of the passed media element. Then, you can change the required properties and pass the resulting parameter to the ASPxClientHtmlEditor.ExecuteCommand method.

// Changing the selected flash element's dimensions and alignment
var flash = htmlEditor.GetSelection().GetSelectedElement();
var args = htmlEditor.CreateChangeMediaElementCommandArguments(flash);
args.align = "center";
args.styleSettings.width = "400px";
args.styleSettings.height = "100px";
htmlEditor.ExecuteCommand(args.GetCommandName(), args);
See Also