0

ページを表示すると、表示されるのは-

<script></script>

私の_Layout.cshtmlは次のようになります

<script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/helpdesk/Scripts")"></script>

Application_Start()のようにGlobal.asxc.cs見えます

protected void Application_Start() {
AreaRegistration.RegisterAllAreas();
BundleTable.Bundles.EnableDefaultBundles();

RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}

何か案は?

4

1 に答える 1

2

デフォルトのバンドルではカバーされないカスタム ディレクトリを使用しています。たとえば、新しいバンドルを追加する必要があります

var bundle = new Bundle("~/helpdesk/js", new JsMinify());
bundle.AddDirectory("~/helpdesk/js", "*.js", true);
BundleTable.Bundles.Add(bundle);

カスタム フォルダが~/Content/helpdesk/js/などのデフォルト ディレクトリの 1 つにある場合~/Scripts/helpdesk/は、これを行う必要はありません。

于 2013-01-07T11:18:36.707 に答える