我已经应用了表单验证,其中缺少的输入将反映在错误消息中。我在localhost中测试时代码工作正常:
但是在我将代码上传到heroku并预览之后,该消息仍然有效,但显示了一些奇怪的字符:
消息div放在表单div中,是否有关于这个奇怪问题的想法?
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Message)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
Activity reply = activity.CreateReply( $" Hello");
reply.Attachments.Add(new Attachment()
{
ContentUrl = $"https://upload.wikimedia.org/wikipedia/en/a/a6/Bender_Rodriguez.png",
ContentType = "image/png",
Name = "Bender_Rodriguez.png"
});
await connector.Conversations.ReplyToActivityAsync(reply);
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
编辑:这是我使用的html文件。
<div className="ui error message"></div>
答案 0 :(得分:0)
以UTF WITH BOM格式保存您的文档;)