【发布时间】:2018-11-15 20:33:13
【问题描述】:
我正在尝试使用 c# 创建自适应表单。我已经安装了 Microsoft.AdaptiveCards Nuget 包,版本为 0.5.1,Bot Builder 版本为 3.14.1.1。
我的卡已在 Skype 频道中正确呈现。但是在单击提交按钮时,表单输入数据 Json 不会传递给 Bot 框架 Post Activity。提交类型是“Action.Submit”。但这适用于网络聊天。
我正在使用下面的代码。
var Makedmessage = context.MakeMessage();
AdaptiveCards.AdaptiveCard card = new AdaptiveCards.AdaptiveCard();
Attachment attach = new Attachment();
attach.ContentType = AdaptiveCards.AdaptiveCard.ContentType;
card.Body = new List<CardElement>() { new TextBlock() { Text = "Present a form and submit it back to the originator" }, new TextInput() { Id = "firstName", Placeholder = "What is your first name?" }, new TextInput() { Id = "lastName", Placeholder = "What is your last name?" } };
card.Actions = new List<ActionBase>() { new SubmitAction() { Title = "Action.Submit" } };
attach.Content = card;
Makedmessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
Makedmessage.Attachments.Add(attach);
await context.PostAsync(Makedmessage, CancellationToken.None);
我该如何解决这个问题?
【问题讨论】:
标签: botframework skype adaptive-cards