I have a custom PageBase class that I am using for all of the pages in my project. In my BaseClass I have a protected override void OnLoad(EventArgs e)
method declared. This method seems to make my derived classes unable to throw their own OnLoad event. What is the preferred way of making both OnLoad events able to work?
views:
619answers:
2
+2
A:
In your derived class:
protected override void OnLoad(EventArgs e)
{
//do the specific work
//....
//
base.OnLoad(e);
}
Sunny
2009-04-02 22:04:26
Yes, this was the solution. Thank you! I also have a base OnInit that I also need to add this to. It's too bad the example I found to do this originially didn't mention this.
Mike C.
2009-04-03 13:18:25
A:
Not sure why this wouldn't work. Are you overriding OnLoad in your derived classes or just hooking up to the Load event? If you are just hooking up to the load event are you sure your base classes OnLoad event is calling base.OnLoad()?
Daniel
2009-04-02 22:05:21