2

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?

1
  • 1
    BundleConfig.cs? See? Nowhere in the tutorials I've been reading online has anyone once mentioned this file. I was sitting here trying to figure out how to fight the VS IDE to get it to reference my files correctly. Commented Jun 16, 2016 at 13:29

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.