无法使用Bundlification在我的ASP.NET项目中加载一些css和js

时间:2017-05-08 10:53:25

标签: javascript css asp.net-mvc bundling-and-minification

//My BundleConfig.cs look like-
public class BundleConfig
{        
    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.validate*",
                    "~/Scripts/jquery.unobtrusive*"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryUI").Include(
                  "~/Scripts/jquery-ui.js",
                  "~/Scripts/CustomAutocomplete.js"));

        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                "~/Scripts/modernizr-*"));

        bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                  "~/Scripts/bootstrap.js",
                  "~/Scripts/respond.js",
                  "~/Scripts/bootstrap-datetimepicker.js"));


        bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/bootstrap-datetimepicker.css",
                  "~/Content/site.css",
                  "~/Content/JqueryUI/jquery-ui.css"));            
    }
}

//In cshtml file calls like-

@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/jqueryval")

在visual studio中运行项目时工作正常,但在服务器上部署后,某些css和js文件无法正确加载 我已按照here解释的那样完成了IIS设置 部署网页后看起来像 after deploy webpage looks like

但网页应该是这样的 But webpage should look like this

请提供解决方案......

0 个答案:

没有答案