473,396 Members | 1,891 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,396 software developers and data experts.

Which Page_Load event is raised first?

Hello, friends,

In a .aspx page, we have a web user control.

In both control and .aspx page, we have Page_Load event.

My question is: Which event will raised first when rendering this page to
clients? Can I change web user control's properties in .aspx Page_Load event
so that control's Page_Load can use the new property values I just assigned?

Thanks.
Jan 20 '06 #1
3 1333
It's recursing starting from the page to controls, to child controls.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
Hello, friends,

In a .aspx page, we have a web user control.

In both control and .aspx page, we have Page_Load event.

My question is: Which event will raised first when rendering this page to
clients? Can I change web user control's properties in .aspx Page_Load
event
so that control's Page_Load can use the new property values I just
assigned?

Thanks.

Jan 20 '06 #2
Thank you, Karl,

In .aspx html, I have:

<uc1:MainMenu id="MainMenu1" name="MainMenu1" runat="server"></uc1:MainMenu>

But, in Page_Load event (c#), I could not see this.MainMenu1. I thought I
should be able to see this web user control I dropped on this page??

Any reference paper, or sample source code? Thanks a lot.

"Karl Seguin [MVP]" wrote:
It's recursing starting from the page to controls, to child controls.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
Hello, friends,

In a .aspx page, we have a web user control.

In both control and .aspx page, we have Page_Load event.

My question is: Which event will raised first when rendering this page to
clients? Can I change web user control's properties in .aspx Page_Load
event
so that control's Page_Load can use the new property values I just
assigned?

Thanks.


Jan 20 '06 #3
It's possible that the decleration for the control simply didn't make it
into codebehind. Sometimes it's automatically generated, sometimes it isn't.

Expand the auto-generated region in your codebehind, and see if you have a
MainMenu1 variable defined, ala:
protected MainMenuMainMenu1;

if it isn't htere, simply add it.
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
Thank you, Karl,

In .aspx html, I have:

<uc1:MainMenu id="MainMenu1" name="MainMenu1"
runat="server"></uc1:MainMenu>

But, in Page_Load event (c#), I could not see this.MainMenu1. I thought I
should be able to see this web user control I dropped on this page??

Any reference paper, or sample source code? Thanks a lot.

"Karl Seguin [MVP]" wrote:
It's recursing starting from the page to controls, to child controls.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
> Hello, friends,
>
> In a .aspx page, we have a web user control.
>
> In both control and .aspx page, we have Page_Load event.
>
> My question is: Which event will raised first when rendering this page
> to
> clients? Can I change web user control's properties in .aspx Page_Load
> event
> so that control's Page_Load can use the new property values I just
> assigned?
>
> Thanks.


Jan 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Lennon | last post by:
Is there an event that is raised that occurrs after a Windows form is displayed for the firt time? The Load event occurrs before the form is displayed for the first time I am looking for an...
13
by: z. f. | last post by:
Hi, i have a class that is derived from System.Web.UI.Page, and this is the class i use in my application as PageBase. all other page classes are deriverd from my PageBase instead of the...
3
by: Studio P.M. | last post by:
Dear colleagues, I kindly ask the C# developers community to help me to REALLY understand the Page_Load event, so to REALLY have it under control. Reason for this question is that I cannot...
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 ?
2
by: Rebecca | last post by:
I have a dynamically created command button on a .net page that adds 1 row to a sql server table when clicked. The page_load event load rows from that table for the user to view, but for some reason...
9
by: Joe | last post by:
I have a DataGrid with a templated column that displays ImageButtons. I need to know if one of these buttons caused the postback or just another button on the form. If one of these buttons caused...
4
by: Shawn | last post by:
Hi. I have a ToolBar with a couple of ToolBarButtons. On postback after clicking on of the buttons Page_Load is called first then the ToolBarButton's click event is called. Is there anyway for...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
1
by: rockdale | last post by:
Hi, I have a masterpage and on the page_load event I Populate my mainmenu from database. I the page_load event of my content, I am trying to programmly select the menuitem that represent...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.