ASP.NET MVC - Bundle Config order

前端 未结 3 1990
Happy的楠姐
Happy的楠姐 2020-11-30 21:43

I\'m trying to use a specific locale (es-CL) in my ASP.NET MVC 5 application. I\'ve the following:

  1. Changed web.config uiculture and culture to \"es-CL\"
  2. <
3条回答
  •  忘掉有多难
    2020-11-30 22:18

    In the last version of MVC 5 (at october 27 of 2014), yo should use this class instead:

    class AsIsBundleOrderer : IBundleOrderer
    {
        public IEnumerable OrderFiles(BundleContext context, IEnumerable files)
        {
            return files;
        }
    }
    

    And create the bundle like the other response:

    var bundle = new ScriptBundle("~/bundles/globalization")
    .Include("~/Scripts/globalize/globalize.js")
    .Include("~/Scripts/globalize/cultures/globalize.culture.es-CL.js")
    .Include("~/Scripts/jquery.validate.globalize.js");
    
    bundle.Orderer = new AsIsBundleOrderer();
    
    bundles.Add(bundle);
    

提交回复
热议问题