469,631 Members | 1,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Difference between Page_Load and Page_Init?


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

Thanks,
/*Raj*/

Nov 20 '05 #1
2 3865
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
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.

Similar topics

1 post views Thread by Christian | last post: by
3 posts views Thread by Christian | last post: by
6 posts views Thread by Dot net work | last post: by
12 posts views Thread by Nathan Sokalski | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.