Answer the question
In order to leave comments, you need to log in
How to connect JS to ASP.NET MVC views?
Colleagues!
Give a recommendation on how best to include third-party JS libraries in ASP.NET view code.
The situation is this: there are a bunch of views, where it is written by hand, for example:
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
Answer the question
In order to leave comments, you need to log in
Only it is better not to connect scripts separately. but use bundles , if, of course, you use asp.net mvc 4 and higher.
And so it is necessary to clearly understand why specific scripts are needed and where they may be needed. If everywhere - then _Layout, if not, then it’s better not to overload _Layout sometimes, but to put it in a separate script section
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question