我正在尝试使用c#创建一个Adaptive表单。我安装了版本0.5.1的Microsoft.AdaptiveCards Nuget包,Bot Builder版本是3.14.1.1。
我的卡已在Skype频道中正确呈现。但是单击Submit按钮,Forms输入数据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);
我该如何解决这个问题?
答案 0 :(得分:1)
Skype频道的自适应卡仍为under development。您必须通过Bot Framework查找其他替代功能,例如multi dialog或formflow,以获取用户的详细信息。