views:

198

answers:

3

Hi,

In my inline .aspx page, I want to override the pre-init event.

How can I do this?

is it:

void pre_init(object sender)

?

Update This is a user control

+1  A: 
protected override void OnPreInit(EventArgs e)
{
    base.OnPreInit(e);
}
John Fisher
that doesn't seem to work. void page_load(..) works though?
How does it not work? Does it fail to compile?
John Fisher
OnPreInit(object, System.EventArgs)': no suitable method found to override
It sounds like you're in an asCx control rather than an asPx page. If this is true, try the OnInit() method instead.
John Fisher
A: 

Have a look at this MSDN page for an overview of the page life cycle and a description of all events you can handle.

M4N
+1  A: 

In your page you can start typing "protected override", hit enter or tab to complete, hit space, and intellisense will give a list of all the stuff you can override. If you pick one from the list it will generate the

base.myOverriddenMethod(e);

etc..

Chet