New to Telerik UI for ASP.NET CoreStart a free 30-day trial

Events

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

Handling by Handler Name

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

Razor
    @(Html.Kendo().Chat()
        .Name("chat")
        .Events(e => e
            .Post("onPost")
            .ActionClick("onActionClick")
        )
    )
    <script>
        function onPost() {
            // Handle the post event.
        }

        function onActionClick() {
            // Handle the action click event.
        }
    </script>

Handling by Template Delegate

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

Razor
    @(Html.Kendo().Chat()
        .Name("chat")
        .Events(e => e
            .Post(@<text>
                function() {
                    // Handle the post event inline.
                }
            </text>)
            .ActionClick(@<text>
                function() {
                    // Handle the action click event inline.
                }
            </text>)
        )
    )

See Also