473,413 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 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 4093
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*/
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.