G
Guest
hey all,
Is OnInit and Page_Init the same thing?
thanks,
rodchar
Is OnInit and Page_Init the same thing?
thanks,
rodchar
There are 3 different things.Is OnInit and Page_Init the same thing?
Peter Bucher said:Hello Rodchar
There are 3 different things.
"Init" is the event
"OnInit" is the method that raises the "Init" event
"Page_Init" (Or some else name) is the name of the eventhandler that is
attached to an (typically Init) event
If you want to handle the event, you can:
1. Wire up the Init Event and handle the event in a eventhanler methode (for
example: Page_Init)
2. Overwrite the "OnInit" method and implement some logic in there,
additionaly you can (or in some cases should) call the base.OnInit()
method, otherwise the implementation of the base class would`t run.
--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.