Reputation: 2614
I would like to include my own custom js and css files in my MVC5 project. Should they be referenced in _Layout.cshtml like:
<script src=...></script>
or should they rather be referenced in BundleConfig.cs?
Upvotes: 2
Views: 1252
Reputation: 38468
Including them in BundleConfig.cs gives you the bundling and minification features built in ASP.NET MVC. Referencing them in the layout does not have any advantages, you won't be able to reduce the request count or size. Use bundling if you are working on ASP.NET MVC 4 or higher.
Upvotes: 1