?
Solved

.NET MVC5 Bundle Config Layout?

Posted on 2014-08-26
5
Medium Priority
?
405 Views
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(
                        "~/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*",
                        "~/Scripts/jquery.validate.unobtrusive.js"));

            bundles.Add(new ScriptBundle("~/bundles/jquery-ajax").Include(
                        "~/Scripts/jquery.unobtrusive-ajax.js"));

            bundles.Add(new ScriptBundle("~/bundles/jquery-ui").Include(
                        "~/Scripts/jquery-ui-1.11.0.js"));
0
Comment
Question by:WorknHardr
  • 3
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
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.
0
 

Author Comment

by:WorknHardr
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?
0
 

Author Comment

by:WorknHardr
ID: 40286744
Off Topic:
   No more points for questions at EE?
0
 
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.
0
 
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.
0

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