0

using the usual syntax

<link rel="stylesheet" href="~/assets/css/bootstrap.min.css">
<link rel="stylesheet" id="css-main" href="~/assets/css/site.css">
<link rel="stylesheet" id="css-main" href="~/assets/css/bluetheme.css">

everything works as it should. In order to clean that up a bit, I wanted to use Style.Render

@Styles.Render("~/assets/css")

which I believe includes all the css files in that folder.

But the styles are not working on the page. What am I doing wrong?

Update: well there were two typos in my BundleConfig but they are now fixed and the style s still dont work

Here is my bundle config

 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.validate*"));

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

        bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                  "~/Scripts/bootstrap.js",
                  "~/Scripts/respond.js"));

        bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/site.css"));
        bundles.Add(new StyleBundle("~/assets/css").Include(
             "~/assets/bootstrap.min.css",
                  "~/assets/site.css",
                   "~/assets/bluetheme.css"
            ));
    }

and this is in the head section of my layout view

 @Styles.Render("~/assets/css")
dinotom
  • 4,990
  • 16
  • 71
  • 139
  • 1
    Have you added your bundleConfig.cs to you global.asax file? – kevin b. May 23 '17 at 15:13
  • yes, but thats where the problem was...two typos – dinotom May 23 '17 at 15:52
  • @Pete, and how is it a duplicate, if the issues are different, the code is correct and the styling doesnt work? – dinotom May 23 '17 at 16:58
  • @dinotom, at the time with the info provided when it was voted to close, it was a duplicate as the other question gives **all** the steps for you to get bundling to work. Now you have edited, I still see no reason to reopen it – Pete May 24 '17 at 07:23
  • Can you give more info? What environment? Is your config setup to enable bundling? Where are you putting the @Styles.Render()? – mbelmont May 23 '17 at 15:13

0 Answers0