Doubt with @Style.Render

Asked

Viewed 706 times

2

If I put in mine view Layout that line:

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

I’m stating that all the files .css in the briefcase Content will be rendered? I mean, I don’t need to put any .css explicitly in my view, is that it? If there are 5 files inside the page, the five will be rendered and already included in my view, is that right? We don’t need lines like that:

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

For each file .css I got it, I got it right?

1 answer

2


This row will only insert site.css who is in /Content. Unless you configure to use others.

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

I put in the Github for future reference.

Documentation.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.