Events in ASP.NET CORE Chat UI control

10 Feb 20251 minute to read

This section describes the Chat UI events that will be triggered when appropriate actions are performed. The following events are available in the Chat UI control.

Created

The Chat UI control triggers the created event when the control rendering is completed.

@using Syncfusion.EJ2.InteractiveChat;

<div style="height:380px; width:450px">
    <ejs-chatui id="chatUser" created="onCreated"></ejs-chatui>
</div>

<script>
    function onCreated() {
        // your required action here..
    }
</script>
public ActionResult Created()
{
    return View();
}

Sending message

The messageSend event is triggered before sending a message in the Chat UI control.

@using Syncfusion.EJ2.InteractiveChat;

<div style="height:380px; width:450px">
    <ejs-chatui id="chatUser" messageSend="messageSend"></ejs-chatui>
</div>

<script>
    function messageSend() {
        // your required action here..
    }
</script>
public ActionResult MessageSend()
{
    return View();
}

User typing

The userTyping event is triggered when the user is typing a message in the Chat UI control.

@using Syncfusion.EJ2.InteractiveChat;

<div style="height:380px; width:450px">
    <ejs-chatui id="chatUser" userTyping="userTyping"></ejs-chatui>
</div>

<script>
    function userTyping() {
        // your required action here..
    }
</script>
public ActionResult UserTyping()
{
    return View();
}