I'm trying to use a specific locale (es-CL) in my ASP.NET MVC 5 application. I've the following:
- Changed web.config uiculture and culture to "es-CL"
- Installed the Globalize and jQuery.Validation.Globalize packages
- Changed the default language in my views:
<html lang="es-cl">
- Created a new Bundle and included in the appropriate views.
In BundleConfig.cs:
bundles.Add(new ScriptBundle("~/bundles/jqueryval")
.Include("~/Scripts/jquery.validate.js")
.Include("~/Scripts/jquery.validate.unobtrusive.js"));
bundles.Add(new ScriptBundle("~/bundles/globalization")
.Include("~/Scripts/globalize/globalize.js")
.Include("~/Scripts/globalize/cultures/globalize.culture.es-CL.js")
.Include("~/Scripts/jquery.validate.globalize.js"));
In the appropriate views:
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/globalization")
}
However, the generated source code is the following:
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Scripts/jquery.validate.globalize.js"></script>
<script src="/Scripts/globalize/globalize.js"></script>
<script src="/Scripts/globalize/cultures/globalize.culture.es-CL.js"></script>
Please note that the jquery.validate.globalize.js script is being loaded before globalize.js, which is not what I want.
Why is this happening? Is it possible to rely in the include order in a single bundle, or am I forced to put this single script in a different bundle and specify it in my view?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…