title: DNN 7 Error custom Module
body: <p>I'm trying to code my own DNN 7 module, to learn.</p>
  
  <p>I'm actually following <a href="http://www.charlesnurse.com/Blog/Post/444/DotNetNuke-Module-Development-101-5-Hello-World-3-Using-Visual-Studio-to-Create-a-Module" rel="nofollow">this tutorial</a>.</p>
  
  <p>I've created the module, and it show this error.</p>
  
  <pre><code>Error: HelloWorld is currently unavailable.
  DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---&gt;
  System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl()
  --- End of inner exception stack trace ---
  </code></pre>
  
  <p>Here my ascx code</p>
  
  <pre><code>&lt;%@ Control Language="C#"
      AutoEventWireup="true"
      CodeFile="HelloWorld.ascx.cs"
      Inherits="DesktopModules.HelloWorld"
  %&gt;
  &lt;h1&gt;Hello Dude&lt;/h1&gt;
  &lt;p&gt;Some text here&lt;/p&gt;
  </code></pre>
  
  <p>And my ascx.cs</p>
  
  <pre><code>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
      {
  
      }
  }
  </code></pre>
  
  <p>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)</p>
  
  <pre><code>override protected void OnInit(EventArgs e)
      {
          InitializeComponent();
          base.OnInit(e);
      }
      private void InitializeComponent()
      {
          this.Load += new System.EventHandler(this.Page_Load);
      }
  </code></pre>