I just recently started using MVC4 & Razor. Previously, there were sections in each view page for ScriptContent, MainContent, etc.
While before I would always put the javascript/jquery I needed in the Script area, now I don’t know how I should handle it. Is there a common practice or a specific place this should go?
There are two parts to the answer:
Bundles are rendered with
@Scripts.Render("~/bundles/<name>")and by default are registered inBundleConfig.RegisterBundlesmethod. This is how you’d normally include jQuery and other frameworks and libraries. There’s more information here.Sections are still there if you need them and are used much like in ASP.NET MVC3.