Hello
I'm creating a custom module and I'm getting the following error below. I'm using Steve Fabian's Gooddog template (which works fine) but I'm trying to apply a multi-view using code from Managing Views In Your DotNetNuke Module by Rafe Kemmis.
If I comment out the following code in BOLD I don't get any error:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
System.Web.UI.Control parent = Parent as System.Web.UI.Control;
while (!(parent is PortalModuleBase))
{
parent = parent.Parent;
}
ModuleConfiguration = ((PortalModuleBase)parent).ModuleConfiguration;
}
AssemblyVersion: 6.2.2
PortalID: 0
PortalName: CSCDNN
UserID: 1
UserName: host
ActiveTabID: 82
ActiveTabName: DirectoryIII
RawURL: /DirectoryIII.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://localhost/DirectoryIII.aspx
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: e578bfb6-7f64-41d2-ba50-50b1d4dc0305
InnerException: Object reference not set to an instance of an object.
FileName: C:\DNN\DesktopModules\DirectoryIII\Common\DirectoryIIIModuleBase.cs
FileLineNumber: 17
FileColumnNumber: 17
Method: CSC.DNN.DirectoryIIIModuleBase.OnInit
StackTrace:
Message: System.NullReferenceException: Object reference not set to an instance of an object. at CSC.DNN.DirectoryIIIModuleBase.OnInit(EventArgs e) in C:\DNN\DesktopModules\DirectoryIII\Common\DirectoryIIIModuleBase.cs:line 17 at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at DotNetNuke.UI.Modules.ModuleHost.InjectModuleContent(Control content) at System.Web.UI.Control.EnsureChildControls() at DotNetNuke.UI.Containers.Container.get_ModuleControl() at DotNetNuke.UI.Containers.Container.ProcessModule() at DotNetNuke.UI.Skins.Pane.InjectModule(ModuleInfo module)
Source:
Server Name: jfrick