javascript - ASP.NET MVC Scripts.Render not merging files..? - Stack Overflow

I've noticed <script type="textjavascript" src="bundlesjqueryval"><

I've noticed <script type="text/javascript" src="/bundles/jqueryval"></script>

Will merge the files into a single HTTP request

But if I use the @Scripts.render I.E @Scripts.Render("~/bundles/jqueryval")

They are still separate HTTP requests/files?

I've noticed <script type="text/javascript" src="/bundles/jqueryval"></script>

Will merge the files into a single HTTP request

But if I use the @Scripts.render I.E @Scripts.Render("~/bundles/jqueryval")

They are still separate HTTP requests/files?

Share edited Sep 1, 2012 at 9:59 Hao Kung 28.2k6 gold badges85 silver badges93 bronze badges asked Aug 14, 2012 at 0:54 williamsandonzwilliamsandonz 16.5k23 gold badges106 silver badges189 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

Make sure you are running in Release mode:

<pilation debug="false" targetFramework="4.0" />

if you want the scripts to be minified and bundled into a single one.

You can also force it by code with BundleTable.EnableOptimizations = true; at BundleConfig

by popular request I add it as an answer

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742290811a4416151.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信