What is the difference between Page_init and Page_Load event?

G

Guest

Hi,

Here is the difference........

Page_init
------------
This event is the first event to occur when an ASP.net page is executed,
this is the event where you should be performing any initialization steps
that you need to setup or create instances of server controls.
Its generally advised not to access controls in this event as there is no
guarantee of the controls been created at this stage, its in this event the
controls are actually created.
This event fires only the first time the page is loaded and from the next
time on a postback Page_init is not fired.

Page_load
-------------
This is the event where most of our work will be done, this event occurs
when all objects/controls on the page are created and will be available for
use.

Unlike Init, this event is loaded everytime when the page is posted back.

Hope this helps,
--
Kannan.V
Home : http://www.kannanv.com
Blog : http://kannanv.blogspot.com
Web : http://www.DotnetLounge.net

"Any one who has never made a mistake has never tried anything new" - Einstein
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top