I'm trying to code my own DNN 7 module, to learn.
I'm actually following this tutorial.
I've created the module, and it show this error.
Error: HelloWorld is currently unavailable.
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()
--- End of inner exception stack trace ---
Here my ascx code
<%@ Control Language="C#"
AutoEventWireup="true"
CodeFile="HelloWorld.ascx.cs"
Inherits="DesktopModules.HelloWorld"
%>
<h1>Hello Dude</h1>
<p>Some text here</p>
And my ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.UI.Modules;
namespace MyModules
{
public partial class HelloWorld : ModuleUserControlBase
{
}
}
Searching on google link me to the following code, but I'm not sure this is the solution (and don't know how to use it properly)
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}