如何通过使用Microsoft Bot Framework V4模板并使用C#单击html文本和h tml表内容的特定区域来获取用户输入,>

问题描述 投票:1回答:1

我正在使用Microsoft Bot Framework开发一个机器人。而且我启用了HTML呈现功能以在网聊频道中显示表格。现在我想做类似的事情:

[当我单击表格行或单元格或定义的文本块或HTML列表项的内容时,它将像按钮一样工作,并且漫游器应监听单击并获取被单击的文本块的值并显示下一个结果。同样,如果可能的话,可以针对特定的可点击区域设置值。

在下面的代码中,我设置了html:true,以便网络聊天频道可以在聊天框中呈现HTML。

const markdownIt = window.markdownit({ html: true, linkify: true, typographer: true });
window.WebChat.renderWebChat({
  directLine: directLine,
  renderMarkdown: markdownIt.render.bind(markdownIt),
  styleOptions          
}, document.getElementById('webchat'));

我从机器人那里发送了这样的HTML

text = "<p>Here is the table result:</p><table class=\"botTable\"><tr> <th> Name </th><th> Id </th><th> Age </th></tr> <tr><td> Prime </td><td> S360 </td><td> 25 </td></tr> <tr><td> Jon01 </td><td> J460 </td><td> 22 </td></tr> </table>";

await stepContext.Context.SendActivityAsync(MessageFactory.Text(text), cancellationToken);

这是示例表:

Sample HTML Table

我在bot框架中非常陌生,请帮助我。谢谢。

我正在使用Microsoft Bot Framework开发一个机器人。而且我启用了HTML呈现功能以在网聊频道中显示表格。现在我想做类似的事情:当我单击表行或内容时...

c# botframework bots
1个回答
0
投票

您应该使用自适应卡

© www.soinside.com 2019 - 2024. All rights reserved.