Solved

Why Bundles is not working on certain files - ASP MVC

Posted on 2016-11-14
3
45 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
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 add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

24 Experts available now in Live!

Get 1:1 Help Now