Raising events from a dynamically loaded user control
<p>I dynamically load a UC in the Oninit of the host page. </p>

<p>In the Oninit of the UC, I raise an event. I get a null reference exception. The code is as below:</p>

<pre><code>//In the UC

public event CommandEventHandler DoneProcessing;
protected override void OnInit(EventArgs e)
{
      //Raise a event
      CommandEventArgs cmdEventArgs = new CommandEventArgs("done", "test");
      DoneProcessing(this, cmdEventArgs);
}
</code></pre>

<p>When I raise the event in Page Load instead of Oninit, it works fine, but I cannot do this since I have to load a child control and for things to work correctly (viewstate etc), I need to do this on OnInit.</p>
