Hello. I have this question. In ASP.NET MVC 4, scripts can be connected via the BundlesConfig.cs file and then on the view render them on the page with this instruction:

@Scripts.Render("~/bundles/mybundle") 

This begs the question - how is it better than the traditional

 <script src="myscript.js" type="text/javascript"></script> 

In any case, with the usual method, only one file needs to be changed, not two as in the first method.

Thank you in advance

    1 answer 1

    Bundles imply the separation of loadable scripts into logical parts. Suppose there is a separate style bundle, a separate JavaScript bundle for libraries, a separate bundle for your scripts. You only need to edit one file, not two. When compiling the MVC page, it will insert all the necessary tags.