472,374 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

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 4019
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian | last post by:
Hi, what is the purpose of having a Page_Init() AND a Page_Load() event handler 'cause both will always be executed on loading a page ? What code do you typically put in one event or in the...
3
by: Christian | last post by:
hi, what is the difference between the Page_Load() and OnLoad() event handlers. do they originate from a different point ?
3
by: malcolm | last post by:
Inside of a Page class, how do I capture the Request object values before the Page_Load event is called of that Page? I have a situation where I have many server controls on a Page that get...
6
by: Dot net work | last post by:
I've read quite a few threads on these groups about this. When someone says the following: "My Page_Load gets called twice on a button click postback" The replies are: "Do you have...
5
by: Jimmy | last post by:
Hi Can someone explain to me what the difference is between a PreRender event and the Page Load event for a webform? ch Jimmy
0
by: jonelling | last post by:
I am having a problem where the page load event is not being fired for certain user controls that I load dynamically in placeholders. Here is what I'm doing in brief, with full test code supplied...
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
6
by: ad | last post by:
Hi, What is the difference between Page_init and Page_Load event?
2
by: RajW | last post by:
In ASP.NET VB, what is the difference between "Page_Load" and "Page_Init"? Thanks, /*Raj*/
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.