New to Telerik UI for ASP.NET Core? Download free 30-day trial

Events

The Telerik UI Editor for ASP.NET Core exposes multiple events that allow you to control and customize the behavior of the component.

For a complete example of the basic Editor events, refer to the demo on using the events of the Editor.

Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

    <script>
        function onChange(e) {
            // Handle the change event.
        }

        function onPaste(e) {
            // Handle the paste event.
        }
    </script>

    @(Html.Kendo().Editor()
        .Name("editor")
        .HtmlAttributes(new { style = "width: 100%; height:470px" })
        .Events(e => e // Configure the client-side events.
            .Change("onChange")
            .Paste("onPaste")
        )
    )
    <script>
        function onChange(e) {
            // Handle the change event.
        }

        function onPaste(e) {
            // Handle the paste event.
        }
    </script>

    <kendo-editor name="editor" 
        style="width: 100%; height:470px"
        on-change="onChange"
        on-paste="onPaste">
    </kendo-editor>

Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

    @(Html.Kendo().Editor()
        .Name("editor")
        .HtmlAttributes(new { style = "width: 100%; height:470px" })
        .Events(e => e
            .Change(@<text>
                function() {
                    // Handle the change event inline.
                }
            </text>)
            .Paste(@<text>
                function() {
                    // Handle the paste event inline.
                }
            </text>)
        )
    )
    <kendo-editor name="editor" 
        style="width: 100%; height:470px"
        on-change="function() {
            // Handle the change event inline.
        }"
        on-paste="function() {
            // Handle the paste event inline.
        }">
    </kendo-editor>

Next Steps

See Also

In this article