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

ASP.NET MVC Chat Overview

The Telerik UI Chat HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI Chat widget.

The Chat allows the user to participate in chat sessions with other users or with chat bots. It provides support for default cards and actions, and enables the configuration of custom templates and custom components.

Initializing the Chat

The following example demonstrates how to define the Chat.

Razor
    @(Html.Kendo().Chat()
        // The name of the Chat is mandatory.
        // It specifies the "id" and the "name" attributes of the widget.
        .Name("chat")
    )

Basic Configuration

The following example demonstrates the available configuration options supported by the Chat component.

Razor
    @(Html.Kendo().Chat()
        .Name("chat")
        // The user configuration of the Chat.
        .User(u => u
            .Name("ChatBot Name")
            .IconUrl("https://demos.telerik.com/kendo-ui/content/chat/avatar.png")
        )
        // Attach the event handlers.
        .Events(e => e
            .Post("onPost")
            .ActionClick("onActionClick")
            .SendMessage("onSendMessage")
            .TypingStart("onTypingStart")
            .TypingEnd("onTypingEnd")
        )
        // Configure the placeholder message.
        .Messages(m => m
            .Placeholder("Type your message")
        )
    )

Functionality and Features

  • Toolbar—The component allows you to add toolbar actions for achieving a more user-friendly conversational UI.
  • Peer-to-Peer Chat—The Chat provides an option for creating a peer-to-peer Chat application by using SignalR.
  • Events—Subscribe to the available client-side events to implement any custom logic.
  • Accessibility—The Chat is accessible for screen readers, supports WAI-ARIA attributes, and delivers keyboard shortcuts for faster navigation.

Next Steps

See Also