0

我似乎无法渲染这些(js 文件)。

布局.cshtml

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
      @if (IsSectionDefined("scripts"))
    {
        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: true)
    }

    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
</head>

索引.cshtml

@section scripts

{   <script src="@Url.Content("~/Scripts/lib/firebugx.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/lib/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/lib/jquery.event.drag-2.0.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/lib/jquery.jsonp-1.1.0.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/slick.core.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/slick.formatters.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/slick.editors.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/plugins/slick.rowselectionmodel.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/slick.grid.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/slick.groupitemmetadataprovider.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/slick.dataview.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jqgrid/js/jquery.jqGrid.min.js")" type="text/javascript"></script>
<script src="/WarehouseJavaScript.js" type="text/javascript"></script>
<script type="text/javascript">

错误:加载资源失败:服务器响应状态为 404(未找到)。

4

1 回答 1

0

错误发生在哪里?页面本身应该加载。这条线有一个问题:

<script src="@Url.Content("~/Scripts/")" type="text/javascript"></script>

并确保您的 WarehouseJavaScript.js 不在脚本文件夹中,否则您必须编辑此行:

<script src="/WarehouseJavaScript.js" type="text/javascript"></script>
于 2013-08-13T09:06:37.943 回答