- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这里,默认的 MVC5 App BundleConfig:
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
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*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
}
}
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/scripts").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery.validate*",
"~/Scripts/modernizr-*",
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
}
}
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/scripts").Include("~/Scripts/*"));
}
}
最佳答案
Wouldn't it be much simpler to have just one bundle, where you will include all the scripts you need?
Bundling and minification are two techniques you can use in ASP.NET 4.5 to improve request load time. Bundling and minification improves load time by reducing the number of requests to the server and reducing the size of requested assets (such as CSS and JavaScript.)
bootstrap.js
的简单表单页面,该怎么办?需要。如果您有兴趣加快一切速度,为什么要加载它呢?
关于asp.net-mvc-4 - 是否有任何理由在 BundleConfig 中有多个 ScriptBundle 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35971147/
这是我目前所做的 bundles.Add(new ScriptBundle("~/bundles/WebformsJS").Include( "~/Scripts/WebForms/Web
我真的不知道我错了什么 我添加了一个名为 'ListDrops-static.js' 的 JavaScript 文件 我已经添加了 bundle 引用 bundles.Add(new Scri
我正在使用 ScriptBundle 并将 EnableOptimizations 设置为 true。 我原来的脚本是 $('.carousel').carousel({ interval: 5000
我的 CSS StyleBundle正在呈现 标签而不是 标签。 这让我摸不着头脑。我一直在寻找我的错字,但一切看起来都很好。 这是我的 BundleConfig.cs public static v
我在 BundleConfig.cs 中定义了以下 ScriptBundle- public class BundleConfig { public static vo
捆绑有什么区别: bundles.Add(new ScriptBundle("~/bundles/jquery") .Include("~/Scripts/jquery-{version}.j
public class BundleConfig { // For more information on Bundling, visit http://go.microsoft.com/f
我正在尝试 MVC4 System.Web.Optimization 1.0 ScriptBundle feature 。 我有以下配置: public class BundleConfig {
我可以在 Bundle.config 文件中包含脚本吗?还是仅适用于样式包? ... Is this possible? 还有人可以提供一个 Bundle
我在 BundleConfig.cs 中有这段代码,它只包含一个脚本 bundles.Add(new ScriptBundle("~/bundles/ui-scripts").Include(
我有一个 script.js 文件,其中包含几个西里尔文字符串。当我尝试使用这样的标准链接加载它时: 西里尔字母变成矩形/badCharsetCaracters。 这解决了问题: 如何使用 AS
我可以使用下面的方法成功地将 jquery 库包含在 ASP.NET MVC 的 ScriptBundle 中 bundles.Add(new ScriptBundle("~/bundles/jque
我有一个模块化的 asp.net 应用程序,其中模块部署在主 .net Web 应用程序下的虚拟目录中。我们有一个包含很多东西的通用模块。我试图将所有通用脚本文件从每个客户端特定项目中移出到一个通用模
我正在使用新的 Bundling and Minification在 ASP.NET 4.5 中 网络表单 应用程序。 UnobtrusiveValidationMode 需要 jquery Scri
using System.Web; using System.Web.Optimization; bundles.Add(new ScriptBundle("~/bundles/jquery").In
我有一个控件,其代码类似于以下内容: Javascript $("#Postcode").autocomplete({ source: '@(Url.Action("AutocompleteH
我正在使用 John Papa 的 SPA 快速启动应用程序来创建我自己的应用程序,并且对于我完成的教程的每个部分,我一直遇到同样的问题。 在教程的新部分中,我必须添加另一个 javaScript 文
我正在尝试使用新的 .net 4.5 webforms 控件在我的母版页中呈现包。我在我的 BundleConfig.cs 中定义了一个脚本包,如下所示: bundles.Add(new Script
这里,默认的 MVC5 App BundleConfig: public class BundleConfig { // For more information on bundling, v
我尝试开始使用 MVC SPA 应用程序,我在 BundleConfig 中注意到以下内容: ScriptBundle("~/scripts/jquery-{version}.js") 这是如何工作
我是一名优秀的程序员,十分优秀!