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

Events

The Telerik UI Editor for ASP.NET MVC 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")
        )
    )

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>)
        )
    )

Next Steps

See Also

In this article