Q: Add OnLoad method to usercontrol I have several controls that inherit BaseUserControl. BaseUserControl inherits System.Web.UI.UserControl.
I want to override OnLoad event like this:   
 public partial class MyControl1 : BaseUserControl
    { 
       protected override void OnLoad(EventArgs e)
       {
          this.Value = myCustomService.GetBoolValue();  
          ///More code here...
          base.OnLoad(e);
       }
    }     

This works great, the only problem is that I have to copy this piece of code across 3 controls, which I do not like. (I do not have access to Base class, since it is inherited by 100s of controls.)   
So, my result currently looks like this:   
public partial class MyControl2 : BaseUserControl
        { 
           protected override void OnLoad(EventArgs e)
           {
              this.Value = myCustomService.GetBoolValue();  
              ///More code here...
              base.OnLoad(e);
           }
        }      
 public partial class MyControl3 : BaseUserControl
        { 
           protected override void OnLoad(EventArgs e)
           {
              this.Value = myCustomService.GetBoolValue();  
              ///More code here...
              base.OnLoad(e);
           }
        }   

What are the good ways to refactor this? One way is to extract   
 this.Value = myCustomService.GetBoolValue();  
                  ///More code here...   

to a separate method, but I was wondering if there's a way that will allow us specify override event only once?

A: You could create an extra base class for those controls sharing functionality and make this class inherits from BaseUserControl
// Change YourBaseControl by a meaningful name
public partial class YourBaseControl : BaseUserControl 
{ 
    protected override void OnLoad(EventArgs e)
    {   
        this.Value = myCustomService.GetBoolValue();  
        ///More code here...
        base.OnLoad(e);
    }
}   

public partial class MyControl2 : YourBaseControl
{
   ...
}

public partial class MyControl3 : YourBaseControl
{
   ...
}   

