.NET MVC5 Bundle Config Layout?

Posted on 2014-08-26
Medium Priority
Last Modified: 2014-08-27
I'm trying to layout our new MVC5 bundles to separate scripts accordingly. I say "Why load more scripts in the Layout page then necessary?" Anyway, here's my layout so far.

Q. Does this look correct?

 public static void RegisterBundles(BundleCollection bundles)
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(

            bundles.Add(new ScriptBundle("~/bundles/jquery-ajax").Include(

            bundles.Add(new ScriptBundle("~/bundles/jquery-ui").Include(
Question by:WorknHardr
  • 3
  • 2
LVL 75

Accepted Solution

käµfm³d   👽 earned 2000 total points
ID: 40286477
Correct for what? Syntax errors? Coding style? Scripts to include?

I don't see anything wrong with the code.

Author Comment

ID: 40286739
ah, as far as grouping scripts. I don't want to guess if its correct. Maybe there is a better way to group?

Author Comment

ID: 40286744
Off Topic:
   No more points for questions at EE?
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40289445
They default to 500 now. The multiplier (that you add if you grade as "A" , "B", "C") still apply, though. EE changed this a week or so ago.
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40289449
Also, I would say you bundle together everything that would make sense to go together in order to make some piece of functionality (or styling) work if you add the bundle to a page. For instance, you might be using JQuery UI for some visual components. But JQuery UI depends on JQuery, so you might bundle the two together into one bundle. In this way, you ensure whichever page that receives the bundle will have both libraries available to it.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question