如何将JS文件与dotnetnuke中的模块,控件和模板相关联?

Abh*_*iya 5 javascript jquery dotnetnuke

我是dotnetnuke的新手,所以我不知道如何将js文件与模块链接,在dotnetnuke中控制模板.

任何人都可以帮助我...

Chr*_*ond 4

如果你想包含 JS 文件,你应该将它们放入模块中的文件夹中(通常是 JS 文件夹)

然后在Codebehind中你可以使用以下语法

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);
Run Code Online (Sandbox Code Playgroud)

示例来自:https ://github.com/ChrisHammond/dnnCHAT/blob/master/View.ascx.cs