DNN 5 - DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl()抛出NullReferenceException

时间:2009-03-06 10:00:39

标签: dotnetnuke dotnetnuke-5

发布作为参考

当重定向到自定义DNN 5模块中的自定义控件时,我得到

InnerException: Object reference not set to an instance of an object.
Method: DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() 

2 个答案:

答案 0 :(得分:9)

通过确保所有自定义控件都继承自 PortalModuleBase

来解决问题

答案 1 :(得分:0)

对我来说,当.ascx.cs控件继承自DotNetNuke.Entities.Modules.ModuleSettingsBase

时,它起作用了