.NET MVC5 Bundle Config Layout?

Posted on 2014-08-26
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
    LVL 74

    Accepted Solution

    Correct for what? Syntax errors? Coding style? Scripts to include?

    I don't see anything wrong with the code.

    Author Comment

    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

    Off Topic:
       No more points for questions at EE?
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    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 74

    Expert Comment

    by:käµfm³d 👽
    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video discusses moving either the default database or any database to a new volume.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now