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

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

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

@section Scripts {  


        
5条回答
  •  自闭症患者
    2020-12-03 14:32

    Its better practice to place your Js file in Script folder and access it from there. You could write this code in view's head to use the js file

    @Scripts.Render("~/Scripts/script.js")
    

提交回复
热议问题