Get HTML Module Contents by Module ID in DNN

只愿长相守 提交于 2019-12-11 13:57:12

问题


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.


回答1:


You should use the controller classes from the Html module:

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

etc.

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



来源:https://stackoverflow.com/questions/27263020/get-html-module-contents-by-module-id-in-dnn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!