我是 dotnetnuke 的新手,所以我不知道如何将 js 文件与模块链接,在 dotnetnuke 中控制模板。
谁能帮帮我...
最佳答案
如果你想包含 JS 文件,你应该将它们放入模块中的文件夹(通常是 JS 文件夹)
然后在代码隐藏中你可以使用下面的语法
ClientResourceManager.RegisterScript(Parent.Page, "~/Resources/Shared/scripts/knockout.js");
ClientResourceManager.RegisterScript(Parent.Page, "~/desktopmodules/DnnChat/scripts/moment.min.js");
ClientResourceManager.RegisterScript(Parent.Page, "~/desktopmodules/DnnChat/scripts/DnnChat.js",150);
示例来自:https://github.com/ChrisHammond/dnnCHAT/blob/master/View.ascx.cs
关于javascript - 如何将 JS 文件与 dotnetnuke 中的模块、控件和模板链接起来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18373766/