Edit this page

Chat HtmlHelper Overview

The Chat HtmlHelper extension 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. The widget provides support for default cards and actions, and enables the configuration of custom templates and custom components.

For more information on new Chat features, refer to the Kendo UI Roadmap.

For more information on the HtmlHelper, refer to the article on the Chat HtmlHelper for ASP.NET MVC.

Basic Usage

The following example demonstrates how to define the Chat by using the Chat HtmlHelper.

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

Configuration

The following example demonstrates the configuration options that are available for the Chat HtmlHelper.

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

See Also