通过DNN中的模块ID获取HTML模块内容 [英] Get HTML Module Contents by Module ID in DNN

查看:101
本文介绍了通过DNN中的模块ID获取HTML模块内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#开发自定义模块,并希望获取位于站点中的HTML模块的内容,以将其显示为模块的一部分.我该如何获取html内容.例如,如果我有一个ID为746的模块,我想用类似的名称来调用它:

I'm developing a custom module in C# and would like to get the contents of an HTML module that is located in the site to display as part of my module. How can I go about getting the html contents. For instance, if I had a module with an ID of 746 I would like to call it with something similar:

var objModule = new ModuleControler();
var myModule = ModuleControler.GetModuleContentsByID(746);
myLabel.text = myModule.html;

有没有办法做到这一点?我所复习的所有课程似乎都已弃用.

Is there a way to do this? All the classes that I have reviewed seem to be deprecated.

推荐答案

您应该使用Html模块中的控制器类:

You should use the controller classes from the Html module:

DotNetNuke.Modules.Html.HtmlTextController.GetAllHtmlText(int ModuleID)

DotNetNuke.Modules.Html.HtmlTextController.GetAllHtmlText(int ModuleID)

由于HTML模块支持工作流程,因此每个模块可能有多个记录.

As the Html module supports workflow there might be more than one record per module.

这篇关于通过DNN中的模块ID获取HTML模块内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆