3

我正在创建一个 DNN 模块,并有一个基于此的工作模块:http: //www.subodh.com/Projects/DNN-Module

当我在 DNN 5.6.2 安装上安装它时,一切正常,除了 .ascx 文件没有复制过来。如果我手动复制 .ascx 文件,则该模块可以正常工作。

我的 .dnn 文件如下所示:

...
<moduleDefinitions>
    <moduleDefinition>
        <friendlyName>SignUp.Control1</friendlyName>
        <defaultCacheTime>0</defaultCacheTime>
        <moduleControls>
            <moduleControl>
                <controlKey />
                <controlSrc>Control1.ascx/Control1.ascx</controlSrc>
                <supportsPartialRendering>True</supportsPartialRendering>
                <controlTitle>Control1</controlTitle>
                <controlType>View</controlType>
                <iconFile />
                <helpUrl />
                <viewOrder>0</viewOrder>
            </moduleControl>
...
        </moduleControls>
    </moduleDefinition>
</moduleDefinitions>
...

具体来说,Control1.ascx 不会被复制到 DesktopModules/SignUp 目录。

我没有收到错误。这是 DNN 在安装模块时所说的相关部分。我安装时没有错误。

...
Info    Component installed successfully - Script
Info    Starting Installation - Module
Info    Module registered successfully - SignUp
Info    Component installed successfully - Module
Info    Starting Installation - Assembly
...

谁能告诉我为什么控件没有复制到适当的目录?

谢谢。

4

2 回答 2

5

看来您的<controlSrc>标签有误,也许您的意思是:<controlSrc>DesktopModules/SignUp.Control1/Control1.ascx</controlSrc>

您还需要在以下文件中提及此文件<component type="File">

<component type="File">
  <files>
    <file>
      <path>Your Desire Path</path>
      <name>Control1.ascx</name>
    </file>
  </files>
</component>
于 2012-11-02T18:45:35.510 回答
2

除了 Ehsan 的回答之外,您还可以使用 MSBuild 和 Chris Hammonds 模板 (http://christoctemplate.codeplex.com),这将创建一个资源 zip,并且您有一个资源节点,而不是每个文件的单个节点

于 2012-11-03T05:21:38.000 回答