Include JavaScript file in partial views

后端 未结 9 1518
别跟我提以往
别跟我提以往 2020-12-02 06:13

I am wondering what the best practice is for including javascript files inside partial views. Once rendered this will end up as a js include tag in the middle of my page\'s

9条回答
  •  爱一瞬间的悲伤
    2020-12-02 06:28

    My preference will be to create a plugin.master page that inherits from your main Site.master. The idea is that you stuff these plugins into plugin.master and make the 8 or so pages that will use this partial view to inherit from plugin.master.

提交回复
热议问题