问题
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