Doubt with @ Style.Render

2

If I put in my view Layout this line:

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

I'm stating that all .css files in Content folder will be rendered? That is, I do not need to explicitly put .css in my view , is that it? If there are 5 files inside the page, the five will be rendered and included in my view , is that right? We do not need lines like this:

<link href="~/Content/font-awesome.min.css" rel="stylesheet" />

For each .css file I have, do I understand it correctly?

    
asked by anonymous 21.05.2017 / 15:21

1 answer

2

This line will only insert site.css which is in /Content . Unless you set to use others.

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

Documentation .

When you use Style.Render you do not need to explicitly load CSS files because it will put them to you. It will load as many as are set in the above code.

    
21.05.2017 / 16:04