ASPxClientHtmlEditor.BeforePaste Event
Occurs before an HTML code is pasted to editor content, and allows you to modify it.
Declaration
BeforePaste: ASPxClientEvent<ASPxClientHtmlEditorBeforePasteEventHandler<ASPxClientHtmlEditor>>
Event Data
The BeforePaste event's data class is ASPxClientHtmlEditorBeforePasteEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
commandName | Gets the name of the processed command. |
html | Gets or sets the HTML markup that is about to be pasted to the ASPxHtmlEditor’s content. |
Remarks
Use the BeforePaste event to modify an HTML code before it is pasted to the editor. The event occurs in the following cases.
- When an end-user presses the CTRL+V key combination.
- When the PASTEHTMLSOURCEFORMATTING_COMMAND, PASTEHTMLMERGEFORMATTING_COMMAND, or PASTEHTMLPLAINTEXT_COMMAND is executed by calling the ASPxClientHtmlEditor.ExecuteCommand or by clicking a paste options bar item.
The event parameter’s ASPxClientHtmlEditorBeforePasteEventArgs.commandName property identifies the command currently being processed. To access the pasted HTML code, use the ASPxClientHtmlEditorBeforePasteEventArgs.html property.
To learn more about paste formatting, see the Paste Formatting topic.
See Also