views:

197

answers:

2

I'm in the process of converting an ASP.Net webform into a User control and there an event that now says

no suitable method found to override

the event code causing the compile error

protected override void OnPreInit(EventArgs e)
{
    //do some stuff
    base.OnPreInit(e);
}

Is there any equivalent for a user control?

+1  A: 

The OnInit override is available. The User Control Lifecycle on MSDN should help you in determining which event to correctly override. In any case what are you trying to achieve?

Ahmad
+1  A: 

No. You'll have to use Init. I cannot think of anything I've ever done in PreInit that couldn't be done in Init just as well.

http://msdn.microsoft.com/en-us/library/system.web.ui.usercontrol_events.aspx

Bryan