自定义创建的DNN模块无法添加到页面

发布于 2024-09-12 09:21:48 字数 209 浏览 0 评论 0原文

我创建了一个带有 2 个 .ascx 文件的自定义 DNN 模块,并已将其成功安装到现有的 DNN 网站。但是当我将自定义创建的模块添加到页面时,没有任何反应。同样在模块定义页面中,我的模块显示为“未使用”。

知道发生了什么吗?我检查了日志查看器,没有与我的模块相关的条目。

附加信息:Visual Studio 2008、.net 3.5、dnn 版本 05.01.04

I have created a custom DNN module with 2 .ascx files that I have installed successfully to an existing DNN website. But when I add the custom-created module to a page, nothing happens. Also in the module definitions page, my module is shown as "not in use".

Any idea what is happening? I have checked the log viewer, there are no entries that are related to my module.

Additional Info: Visual Studio 2008, .net 3.5, dnn version 05.01.04

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执着的年纪 2024-09-19 09:21:48

您的问题很可能出在模块的模块定义中。您必须将其中一个控件列为“视图”控件类型。

一般来说,要专门显示用户控件(并且页面上没有其他模块),您可以按照以下 Url 格式进行请求:
example.com/pagename/tabid/xx/ctl/ctlkey/mid/yyy/default.aspx

其中:
xx 是 tabid
yy 是模块 ID
ctlkey 是模块控件定义中配置的控件的键。

每个 DNN 模块都有一种“视图”类型,这意味着 /ctl/ctlkey/mid/yyy 不需要包含在 Url 中 - 因此 example.com/pagename/tabid/xx/defualt.aspx 的标准 url 将显示页面上的所有模块,特别是具有“视图”类型的控件。因此,“视图”类型没有关联的键。

因此,要解决您的问题,请转到模块定义页面,单击模块,然后检查是否列出了“视图”类型控件,并且视图类型是否指向实际的模块控件。

最后,不要忘记它可能工作正常,但您的模块实际上并未生成任何有效的 Html。可以通过在控件的页面加载中放置断点并查看它是否被触发来检查。

Your problem is most likely in the module definitions for the module. You must have one of the controls listed as a control type of 'view'.

In general, to display a usercontrol specifically (and no other modules on the page), you request under the Url format of:
example.com/pagename/tabid/xx/ctl/ctlkey/mid/yyy/default.aspx

Where:
xx is the tabid
yy is the module id
ctlkey is the key of the control as configured in the module control definition.

Each DNN module has a type of 'view' which means the /ctl/ctlkey/mid/yyy does not need to be included in the Url - so a standard url of example.com/pagename/tabid/xx/defualt.aspx will show all modules on the page, specifically the controls that have a type of 'view'. Because of this, the 'view' type doesn't have an associated key.

So, to solve your problem, go to your module definitions page, click on the module, then check you have a 'view' type control listed, and that the view type points to an actual module control.

Finally, don't forget it might be working OK but your module isn't actually producing any valid Html. This can be checked by putting a breakpoint in the page load for the control and seeing if it gets triggered.

情栀口红 2024-09-19 09:21:48

我会检查控件已注册的扩展。如果不是,那将是难题的第一部分 - 如果是,您可能只想重新安装模块。

您是否让该模块在其他地方工作过?

I would check in the extensions that the controls are registered. If they arent that would be the first piece of the puzzle - if they are you may want to simply reinstall the module.

Have you had the module work anywhere else?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文