提问人:Filip Mráz 提问时间:11/7/2023 最后编辑:marc_sFilip Mráz 更新时间:11/7/2023 访问量:20
添加 <video> 元素后 C# ASP.NET MVC 应用程序冻结
C# ASP.NET MVC application freezes after adding <video> element
问:
我遇到了一个奇怪的问题。我有一个网站,我想有 2 个视频元素。在添加这些元素之前,网站运行平稳(又名我能够选择文本,单击按钮并重定向到不同的操作)但是在将 2 个视频元素添加到站点后没有响应。我什至没有在视频中添加任何来源。当我添加源时,视频播放,但网站仍然没有响应。我禁用了预加载,并且不包括自动加载。这是我和它的控制器,如果它有帮助的话。Index.cshtml
Index.cshtml
Index.cshtml:
<div class="center">
@if(ViewBag.CourtNumber == null)
{
<h4>Choose court number:</h4>
@model CourtNumber
<form class="gap" asp-action="UpdateCourt">
<select asp-for="Number">
@for(int i = 1; i < ViewBag.CourtOptions + 1; i++)
{
<option value="@i">Court @i</option>
}
</select>
<button type="submit">Submit</button>
</form>
}
<div class="video-container center">
<video preload="none" poster="IMG/NO_MEDIA.png">
</video>
<video preload="none" poster="IMG/NO_MEDIA.png">
</video>
</div>
</div>
家庭控制器:
public IActionResult Index()
{
ViewBag.Title = this.Title;
ViewBag.CourtOptions = this.CourtOptions;
if (Request.Cookies["court"] != null)
{
this.CourtNumber = Convert.ToInt32(Request.Cookies["court"]);
}
ViewBag.CourtNumber = this.CourtNumber;
ViewBag.CamURL = _camTools.GenerateCamURL(this.CourtNumber);
return View();
}
答: 暂无答案
上一个:单个表单元格下的多个值 [关闭]
评论