Solved

Why Bundles is not working on certain files - ASP MVC

Posted on 2016-11-14
3
83 Views
Last Modified: 2016-11-17
Hi Experts,

I added a bunch of css previously and its working fine  in bundles config file . But last time added some more css and am not able to get the css . It throws no error and my site is loading without those css.


 bundles.Add(new StyleBundle("~/css/Home").Include(
                "~/css/grid12.css",
                "~/css/james_typography.css",
                "~/css/main.css",
                "~/css/color_scheme_light.css",
                "~/css/colors/color_palette_blue.css",
                "~/css/rapid-icons.css",
                "~/css/js_styles/jquery.maximage.min.css",
                "~/css/responsivity.css",
                "~/css/animate.css",
                "~/css/nivo-lightbox.css",
                "~/css/nivo_lightbox_themes/default/default.css",
                "~/css/owl.carousel.css",
                "~/css/owl.theme.css",
                "~/css/owl.transitions.css"
                ));

Open in new window









Thanks in Advance Experts
0
Comment
Question by:karthik80c
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
SSupreme earned 500 total points
ID: 41886086
Try it like this:
@Styles.Render("~/css/home.css")
bundles.Add(new StyleBundle("~/css/home.css").Include(
                "~/css/grid12.css",
                "~/css/james_typography.css",
                "~/css/main.css",
                "~/css/color_scheme_light.css",
                "~/css/colors/color_palette_blue.css",
                "~/css/rapid-icons.css",
                "~/css/js_styles/jquery.maximage.min.css",
                "~/css/responsivity.css",
                "~/css/animate.css",
                "~/css/nivo-lightbox.css",
                "~/css/nivo_lightbox_themes/default/default.css",
                "~/css/owl.carousel.css",
                "~/css/owl.theme.css",
                "~/css/owl.transitions.css"
                ));

Open in new window

Make sure you don't have home.css in that directory
1
 

Author Comment

by:karthik80c
ID: 41891341
Why we don't have  home.css in directory . Is there any reason on this
0
 
LVL 16

Expert Comment

by:SSupreme
ID: 41891509
Because it creates virtual file, and if there is a file with same name it could break execution. You can give it any name as long as it doesn't exist in that folder.
1

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

632 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