Event subscription between base classes C# ASP.Net 2.0
Posted on 2007-04-04
We have an aspx page which we would like to subscribe to an event raised by a business layer class. The aspx page inherits from a presentation layer base class. The business layer class also inherits from a business layer base class which defines and throws the event we wish to subscribe to.
The presentation base class currently subscribes to the event. Our idea is that once the event is fired in the business layer base class, it will be picked up by the presentation layer base class and will subsequently be passed on to the aspx class. However this does not work.
When we subscribe to the event from the aspx page (rather than the presentation base class) the event is picked up as expected.
Note that the event handler execution is located in the presentation base class.
We would like the presentation base class subscribe directly to the event and handle the event as well, bypassing the need for all of our aspx pages to subscribe to the event.