我在 EPiServers 论坛上发布了同样的问题并弄明白了。
WidgetType 属性中的数据出了问题。
[Component(
PlugInAreas = "/episerver/cms/assets",
Categories = "cms",
WidgetType = "mycomponents.testModule", //was wrong, I had to define "mycomponents".
Title = "test component",
Description = "A componenet")]
public class testModuleComponent
{
}
我必须定义一个 dojo 可以识别的命名空间。我在 module.config 中做了这个。这是我的模块配置:
<?xml version="1.0" encoding="utf-8"?>
<module>
<dojoModules>
<add name="mycomponents" path="~/ClientResources/Scripts" />
</dojoModules>
</module>
Scripts 是包含 dojo 脚本的文件夹。我将 ~/ClientResources/Scripts 定义为名为 mycomponents 的命名空间的根。
EPiServer 自动为您包含 dojo,因此您不必自己做。
查看此线程: http://world.episerver.com/Modules/Forum/Pages/thread.aspx?id=63255&pageIndex=1#reply .
我是一名优秀的程序员,十分优秀!