admin管理员组

文章数量:1332389

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

本文标签: javascriptASPNET MVC ScriptsRender not merging filesStack Overflow