New to Telerik UI for ASP.NET Core? Download 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.

    @(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>
    <script>
        function onPost() {
            // Handle the post event.
        }

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

    <kendo-chat name="chat"
        on-post="onPost"
        on-action-click="onActionClick">
    </kendo-chat>

Handling by Template Delegate

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

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

    <kendo-chat name="chat"
        on-post="function() {
            // Handle the post event inline.
        }"
        on-action-click="function() {
            // Handle the action click event inline.
        }">
    </kendo-chat>

See Also

In this article