ASPxRichEdit.InsertContentToClient Event
Fires when the client RichEditCommands.insertContentFromServer command is executed.
Namespace: DevExpress.Web.ASPxRichEdit
Assembly: DevExpress.Web.ASPxRichEdit.v19.2.dll
Declaration
Event Data
The InsertContentToClient event's data class is InsertContentToClientEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
KeepLastParagraph | Gets or sets whether the last paragraph of the inserted document is kept in the resulting document. |
RequestId | Gets the identifier of the request to the server. |
Result | Specifies the value passed to the client model. |
Remarks
Use the InsertContentToClient event’s handler to create a server-side document’s model and pass it to the client model. The model is passed to the client using the e.Result parameter as demonstrated in the code example below:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function onInsertTextClick() {
richEdit.commands.insertContentFromServer.execute('text');
}
function onInsertModelClick() {
richEdit.commands.insertContentFromServer.execute('model');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxButton runat="server" ID="InsertText" Text="Insert Text">
<ClientSideEvents Click="onInsertTextClick" />
</dx:ASPxButton>
<dx:ASPxButton runat="server" ID="InsertModel" Text="Insert Model">
<ClientSideEvents Click="onInsertModelClick" />
</dx:ASPxButton>
<dx:ASPxRichEdit ID="ASPxRichEdit1" ClientInstanceName="richEdit" runat="server" WorkDirectory="~\App_Data\WorkDirectory" OnInsertContentToClient="ASPxRichEdit1_InsertContentToClient">
</dx:ASPxRichEdit>
</div>
</form>
</body>
</html>
Note that the e.Result parameter should be represented by a string or the Document class’s instance.
See Also