alert(x)是假的.但由于某种原因,它不会进入if语句?有任何想法吗?
HTML
@{bool x = false;
foreach (var c in Model.Cleaner.TimeConfirmations.Where(l => l.date.ToShortDateString() == DateTime.Now.ToShortDateString() || l.date.ToShortDateString() == DateTime.Now.AddDays(1).ToShortDateString()))
{
x = true;
}
<span class="ifAvailable" data-confirmationchecker="@x" value="15">@x</span>
}
Run Code Online (Sandbox Code Playgroud)
jQuery的
var x = $(".ifAvailable").data('confirmationchecker')
alert(x);
if ( x == false) {
alert("hi")
}
Run Code Online (Sandbox Code Playgroud) 我可以选择上传图片
<input class="images" type="file" id="item" name="Images" />
Run Code Online (Sandbox Code Playgroud)
然后它会像这样保存到我的项目中
Guid g = Guid.NewGuid();
Images.SaveAs(Server.MapPath("~/Uploads/" + g + ".jpg"));
fileNames = g.ToString() + ".jpg";
Run Code Online (Sandbox Code Playgroud)
出于某种原因,当有人从手机将图片上传到网站时,它会侧身显示?
冒着听起来很愚蠢的风险。
我正在尝试重定向到另一个控制器中的操作
这是我的代码
return this.RedirectToAction("s", "profile", new { id = CleanerId });
Run Code Online (Sandbox Code Playgroud)
为什么它不起作用?
“s”是控制器,“profile”是操作。