Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does base.OnPreInit(e) mean?

Tags:

asp.net

events

Any one could simply tell me what does base.OnPreInit(e) mean ?

Thank you

like image 308
Mostafa Avatar asked Dec 05 '25 13:12

Mostafa


1 Answers

The OnPreInit method is called at the beginning of the page initialization stage.

When you are overriding this in your page, you'll have something like

protected override void OnPreInit(EventArgs e)
{
   base.OnPreInit(e);
   ...
   // do something else 

}

where base.OnPreInit(e) calls the Page class's OnPreInit(). If you don't have extra functionality to add to your page then you don't have to override OnPreInit

like image 134
Bala R Avatar answered Dec 08 '25 08:12

Bala R



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!