By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,433 Members | 776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,433 IT Pros & Developers. It's quick & easy.

Difference between Page_Load and Page_Init?

P: n/a

In ASP.NET VB, what is the difference between "Page_Load" and
"Page_Init"?

Thanks,
/*Raj*/

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
PAGE_INIT

The Page_Init event is the first to occur when an ASP.NET page is executed.
This is where you should perform any initialization steps that you need to
set up or create instances of server controls. You don't want to try to
access controls in this event because there is no guarantee that they have
been created yet. It is during this event that they are created, and you can
control whether your attempt to use these objects will be thwarted by the
server processing your request before the object has been created.

Note that the Page_Init event fires only the first time the page is loaded.
When you use a web form and post back to this page again, the Page_Init
event doesn't fire. But the Page_Load event fires each time the page loads.

PAGE_LOAD

This is the page event where you will be doing most of your work. This event
occurs only when all the objects on the page have been created and are
available for use.

HTH,

Raymond Lewallen

"RajW" <ra*@intelc64.net> wrote in message
news:sg********************************@4ax.com...

In ASP.NET VB, what is the difference between "Page_Load" and
"Page_Init"?

Thanks,
/*Raj*/

Nov 20 '05 #2

P: n/a
PAGE_INIT

The Page_Init event is the first to occur when an ASP.NET page is executed.
This is where you should perform any initialization steps that you need to
set up or create instances of server controls. You don't want to try to
access controls in this event because there is no guarantee that they have
been created yet. It is during this event that they are created, and you can
control whether your attempt to use these objects will be thwarted by the
server processing your request before the object has been created.

Note that the Page_Init event fires only the first time the page is loaded.
When you use a web form and post back to this page again, the Page_Init
event doesn't fire. But the Page_Load event fires each time the page loads.

PAGE_LOAD

This is the page event where you will be doing most of your work. This event
occurs only when all the objects on the page have been created and are
available for use.

HTH,

Raymond Lewallen

"RajW" <ra*@intelc64.net> wrote in message
news:sg********************************@4ax.com...

In ASP.NET VB, what is the difference between "Page_Load" and
"Page_Init"?

Thanks,
/*Raj*/

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.