reference jquery assembly in web.config

左心房为你撑大大i 提交于 2020-01-06 13:09:08

问题


Is it possible to put a reference to JQuery (or any other javascript file) in my webconfig, so that then I won't have to keep referencing in every page I create that uses it?

I can imagine if I ever upgrade the version etc. - it will be a bit of a hassle having to rename all these files.


回答1:


You can use a Master Page for this.




回答2:


i am sure that their is no good way or best practice to do that in web.config

their is a little and good way to follow

put the reference in master page [if you use ASPX viewengine]

put the reference in layout page [if you use razor viewengine]

putting the javascript from cdn is also better



来源:https://stackoverflow.com/questions/5137856/reference-jquery-assembly-in-web-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!