@@ -125,7 +125,7 @@ Use the `MessageSend`event of the `SfChatUI` component to handle message exchang
125125Create or modify a Razor component (e.g., ` Pages/Chat.razor ` ) to integrate the Syncfusion Chat UI with the Direct Line API:
126126
127127{% tabs %}
128- {% highlight razor %}
128+ {% highlight cshtml %}
129129
130130@using Syncfusion.Blazor.InteractiveChat
131131@using Syncfusion.Blazor
@@ -172,7 +172,7 @@ Create or modify a Razor component (e.g., `Pages/Chat.razor`) to integrate the S
172172
173173 // Use JSInterop to initialize Direct Line (client-side for real-time updates)
174174 var directLine = await JS.InvokeAsync<IJSObjectReference>("eval",
175- $" new BotFramework.DirectLine.DirectLine({{ token: '{data.token}' }})" );
175+ ` new BotFramework.DirectLine.DirectLine({ token: '$ {data.token}' })` );
176176
177177 isConnected = true;
178178
@@ -181,14 +181,14 @@ Create or modify a Razor component (e.g., `Pages/Chat.razor`) to integrate the S
181181 }
182182 catch (Exception ex)
183183 {
184- await ChatUI.AddMessageAsync(new ChatMessage { Text = "Sorry, I couldn’ t connect to the bot.", Author = BotUserModel });
184+ await ChatUI.AddMessageAsync(new ChatMessage { Text = "Sorry, I couldn' t connect to the bot.", Author = BotUserModel });
185185 Console.WriteLine($"Connection error: {ex.Message}");
186186 return;
187187 }
188188 }
189189
190190 // Send message to bot via JSInterop
191- await JS.InvokeVoidAsync("sendToBot", /* directLine ref or global */ , args.Message.Text, currentUserId);
191+ await JS.InvokeVoidAsync("sendToBot", directLine, args.Message.Text, currentUserId);
192192 args.Cancel = true; // Prevent default send
193193 }
194194
0 commit comments