我正在使用外部服务为表单提交重构一个网站,一旦他们向我发送表单数据,他们希望一串http响应让他们知道我收到了他们的POST.
当网站处于web forms/aspx时,这就是之前的情况.
Response.ContentType = "text/plain";
Response.Output.Write("OK");
Response.Output.Flush();
Response.Output.Close();
Run Code Online (Sandbox Code Playgroud)
所以我先在我的控制器中尝试了这个:
public ActionResult Index()
{
//...get the form data...
return new HttpStatusCodeResult(HttpStatusCode.OK);
}
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用.然后我尝试了:
public ActionResult Index()
{
//...get the form data...
Response.StatusCode = 200;
Response.StatusDescription = "OK";
return new HttpStatusCodeResult(HttpStatusCode.OK, "OK");
}
Run Code Online (Sandbox Code Playgroud)
它仍然无法正常工作.我不知道他们是否得到了200并且没有得到"OK"字符串?
编辑:由于没有工作,我的意思是外部服务没有收到我的"确定"字符串.
在 Vue 中处理“未编译内容的闪现”时,在页面加载的瞬间(或更多)你看到{{ Mustache }},我见过有人同时使用v-text和v-cloak。
使用 v-text,文档说:
更新元素的
textContent. 如果需要更新 的部分textContent,则应使用{{ Mustache }}插值。
使用 v 斗篷:
该指令将保留在元素上,直到关联的 Vue 实例完成编译。结合 CSS 规则,例如
[v-cloak] { display: none },此指令可用于隐藏未编译的 mustache 绑定,直到 Vue 实例准备就绪。
所以听起来如果我不需要更新textContent,我可以使用两者来实现相同的结果。除此之外,v-text和之间有什么区别v-cloak?在隐藏方面,一种比另一种更好{{ Mustache }}吗?
我试图让图像在背景中显示为一个统一的图像.我究竟做错了什么?谢谢.
.content{
background-color: gray;
top: 0;
position: relative;
background-size: cover;
left: 0;
right: 0;
bottom: 0;
background:url(cropped.jpg);
background-repeat: no repeat;
}
Run Code Online (Sandbox Code Playgroud) asp.net ×1
asp.net-mvc ×1
c# ×1
css ×1
css3 ×1
html ×1
html5 ×1
javascript ×1
vue.js ×1
vuejs2 ×1