0

Scripts and Styles not rendering in page

HTML Source Code OF MVC ASP.NET

<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width" />
        <title>@ViewBag.Title</title>   
        @Styles.Render("~/Content/css")        
    </head>

    <body >
    @Scripts.Render("~/Scripts/js")
    @RenderSection("Scripts", false)  
    </body>
</html>

This Is All My Scripts and styles BundleConfig File of c#, i did all i know

  public class BundleConfig
        {
    // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
            public static void RegisterBundles(BundleCollection bundles)
            {
               BundleTable.EnableOptimizations = true;

                bundles.Add(new ScriptBundle("~/Scripts/js").Include(
                    "~/Scripts/jquery-{version}.js",
                    "~/Scripts/angular.js",
                    "~/Scripts/ang/app.js",
                    "~/Scripts/jquery.unobtrusive-ajax.min.js",
                    "~/Scripts/jquery-ui-1.11.2.js",
                    "~/Scripts/jquery.bpopup.min.js",
                    "~/Scripts/jquery-ui.min.js",                    
                    "~/Scripts/jquery.validate.min.js",
                    "~/Scripts/jquery.validate.unobtrusive.min.js",
                    "~/Scripts/ui.dropdownchecklist-1.4-min.js",
                    "~/Scripts/sweetalert.min.js",
                    "~/Scripts/jquery.lettering.js",
                    "~/Scripts/ang/app.js",
                    "~/Scripts/js/JavaScript1.js",
                    "~/Scripts/js/JavaScript2.js"                              
                    )); 
                bundles.Add(new StyleBundle("~/Content/css").Include(
                     "~/Content/jquery-ui.css",
                     "~/Content/css/StyleSheet.css",
                     "~/Content/StyleSheet1.css"     ,
                     "~/Content/jquery-ui.css",
                     "~/Content/ui.dropdownchecklist.standalone.css",
                     "~/Content/ui.dropdownchecklist.themeroller.css",
                     "~/Content/sweetalert.css",
                     "~/Content/animate.css"    
                      ));

                // Set EnableOptimizations to false for debugging. For more information,
                // visit http://go.microsoft.com/fwlink/?LinkId=301862        
            }

Result OF HTML Source Code OF MVC ASP.NET AS YOU CAN SEE THERE NONE SCRIPTS ANS STYLES

<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width" />
        <title>Index</title> 
        <link href="/Content/css" rel="stylesheet"/>
  </head>
<body >
     <script src="/Scripts/js"></script>      
</body>
</html>
drneel
  • 2,887
  • 5
  • 30
  • 48
Link
  • 57
  • 4

2 Answers2

0

add BundleConfig.RegisterBundles(BundleTable.Bundles); to Global.asax

Link
  • 57
  • 4
0

You may be loading jquery.ui.css twice...

"~/Content/jquery-ui.css",
"~/Content/css/StyleSheet.css",
"~/Content/StyleSheet1.css"     ,
"~/Content/jquery-ui.css"

See first and last lines...

dawriter
  • 425
  • 3
  • 8
  • 21