I have a problem with rendering JavaScript file in _Layout.cshtml.
@section Scripts {
<script src="@Url.Content("~/Scripts/Custom/productsSuggests.js")"></script>
}
When I paste it to Index.cshtml (Home) it works, but only on this page. I need this script to work globally. I have partial view SearchBox in HomeViews catalog, and Controller Action in HomeController.
Scripts. Do you actually render it later withRenderSection? Are you sure you need a section in the first place given that you're putting this into layout?