title: C# Events handling problem for base and derived classes
body: <p>I have this case where I'm creating 2 different event handlers placed in a base class and subscribing to them accordingly from Quotes and Charts classes. Problem I'm having is that the first subscription triggers fine for the first event but any following subscriptions don't get executed. I have included an example of 2 different handlers, Quotes and Charts, Quotes executes first time with no problems, but Charts does not trigger when data is received.</p>
  
  <p>Base Class:</p>
  
  <pre><code>public abstract class MyBaseClass
  {
      protected virtual void RaiseOnQuoteData(string item) { }
      protected virtual void RaiseOnChartData(string item) { }
  
      void OnDataReceived(object sender, DataEventArgs e)
      {
          if (e.Item == "QUOTE")
              RaiseOnQuoteData(e.Item);
          else if (e.Item == "CHART")
              RaiseOnChartData(e.Item);
      }
  }
  </code></pre>
  
  <p>Quote and Chart Classes:</p>
  
  <pre><code>public class Quote : MyBaseClass
  {
      public event EventHandler&lt;DataEventArgs&lt;quoteRecord&gt;&gt; OnQuoteData;
  
      protected override void RaiseOnQuoteData(string item)
      {
          OnQuoteData.Raise&lt;DataEventArgs&lt;quoteRecord&gt;&gt;(this, new DataEventArgs&lt;quoteRecord&gt;(item));
      }
  }
  
  public class Chart : MyBaseClass
  {
      public event EventHandler&lt;DataEventArgs&lt;chartRecord&gt;&gt; OnChartData;
  
      protected override void RaiseOnChartData(string item)
      {
          OnChartData.Raise&lt;DataEventArgs&lt;chartRecord&gt;&gt;(this, new DataEventArgs&lt;chartRecord&gt;(item));
      }
  }
  </code></pre>
  
  <p>Subscription:</p>
  
  <pre><code>public class QuoteSubscription
  {
      public static void SubscribetoQuoteData()
      {
          Quote Q = new Quote();
          Q.OnQuoteData += new EventHandler&lt;DataEventArgs&lt;quoteRecord&gt;&gt;(q_OnQuoteData);
      }
  
      static void q_OnQuoteData()
      { 
          //Executes fine
      }
  }
  
  public class ChartSubscription
  {
      public static void SubscribetoChartData()
      {
          Chart C = new Chart();
          C.OnChartData += new EventHandler&lt;DataEventArgs&lt;chartRecord&gt;&gt;(q_OnChartData);
      }
  
      static void q_OnChartData()
      {
          //Does not execute
      }
  }
  </code></pre>
  
  <p>This is implemented in ASP.NET 4.0, Is there any chance that instantiating the derived classes could be the problem since both classes do share the same base class? Any help pointing to the cause would be greatly appreciated.</p>