的.cshtml文件運行時,這是我的.cshtml
文件的形式結構劇本從來沒有在MVC
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dashboard</title>
<link rel="stylesheet" href="~/lib/Hover/hover.css" />
<link rel="stylesheet" href="~/lib/fontawesome/css/font-awesome.css" />
<link rel="stylesheet" href="~/lib/weather-icons/css/weather-icons.css" />
<link rel="stylesheet" href="~/lib/ionicons/css/ionicons.css" />
<link rel="stylesheet" href="~/lib/jquery-toggles/toggles-full.css" />
<link rel="stylesheet" href="~/lib/morrisjs/morris.css" />
<link rel="stylesheet" href="~/lib/select2/select2.css" />
<link rel="stylesheet" href="~/lib/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" />
<link rel="stylesheet" href="~/css/quirk.css" />
<script src="~/lib/modernizr/modernizr.js"></script>
<script>
alert("hello from top");
</script>
</head>
<body style="background:none;">
---Several divs------
<script src="~/lib/jquery/jquery.js"></script>
<script src="~/lib/jquery-ui/jquery-ui.js"></script>
<script src="~/lib/bootstrap/js/bootstrap.js"></script>
<script src="~/lib/jquery-toggles/toggles.js"></script>
<script src="~/lib/morrisjs/morris.js"></script>
<script src="~/lib/datatables/jquery.dataTables.js"></script>
<script src="~/lib/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.js"></script>
<script src="~/lib/select2/select2.js"></script>
<script src="~/js/quirk.js"></script>
<script>
alert("hello from bottom");
</script>
</body>
</html>
實際上它是由我們的設計師提供的設計,從頭部的第一個警告消息被成功彈出,以便它的當然,在我的瀏覽器中JavaScript沒有被禁用,但是最後的警報從不顯示。當我連接外部腳本時,那也永遠不會起作用。這真的很煩人。我引用this問題和更多在stackoverflow,但沒有解決。
我怎樣才能知道這裏發生了什麼?是否因爲以前的js
文件中有錯誤?或者是因爲舊的html4?除了return View();
聲明之外,我的Action方法中沒有任何內容,所以我認爲沒有必要發佈。
另外一件事是我已經在身體中使用了@Html.Action("...")
提供了一個局部視圖,我認爲這不是問題,因爲我試圖刪除它。請指導我,我是一名初學者。
嘗試將佈局設置爲null。 –