How to include js files in the view. ASP.NET MVC 4

后端 未结 5 2162
迷失自我
迷失自我 2020-12-03 13:57

I wonder why my js file work when I call it in the view:

@section Scripts {  


        
5条回答
  •  猫巷女王i
    2020-12-03 14:14

    I'm having the same problem. In my Layout.cshtml file I have @RenderSection("Scripts", required: false) at the bottom before my closing body tag.

    In my index.cshtml I have

    @section Scripts{
        
    }
    

    But it's not working. It was working fine on the homepage before I implemented the shared layout file. Would like to have a better understanding of whats going on here...

提交回复
热议问题