New to Telerik UI for ASP.NET MVC? Start a free 30-day trial
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.
Razor
@(Html.Kendo().Chat()
.Name("chat")
.Events(e => e
.SendMessage("onSendMessage")
.SuggestionClick("onSuggestionClick")
)
)
<script>
function onSendMessage() {
// Handle the "SendMessage" event.
}
function onSuggestionClick() {
// Handle the "SuggestionClick" 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
.SendMessage(@<text>
function() {
// Handle the SendMessage event inline.
}
</text>)
)
)