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