title: ASP.NET event is invoked but throws error
body: <p>This is what my <code>LoginControl</code> class looks like:</p>
  
  <pre><code>namespace WebApplication3
  {
      public partial class LoginControl : System.Web.UI.UserControl
      {
          public event EventHandler ButtonLoginClick;
  
          protected void Page_Load(object sender, EventArgs e)
          {                
          }
  
          protected void btnLogin_Click1(object sender, EventArgs e)
          {
              ButtonLoginClick(sender, e);
          }
      }
  }
  </code></pre>
  
  <p>On the page on which I am using the control, I have the following code:</p>
  
  <pre><code>&lt;myComps:LoginControl runat="server" ID="LoginControl" ButtonLoginClick="btnLogin_Click"&gt;&lt;/myComps:LoginControl&gt;
  </code></pre>
  
  <p>When I click on the login button, the event is not fired because I receive the following error</p>
  
  <blockquote>
    <p>An object is not instantiated.</p>
  </blockquote>
  
  <p>I guess it is speaking of the event. The error happens exactly when I invoke the event <code>ButtonLoginClick</code>.   </p>