Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8142035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:41:47+00:00 2026-06-06T12:41:47+00:00

Is there an event that is triggered after all Page_Load events have completed? How

  • 0

Is there an event that is triggered after all Page_Load events have completed?

How can i have more than one Page_Load?
When you have user controls.

Before my page can render, i need my page (and all embedded controls) to have initialized themselves by completing their Page_Load events.

The problem, of course, is that if i put code in my page’s Page_Load handler:

MyPage.aspx
   --> Page_Load
          ---> DoSomethingWithUserControl()
UserControl1.ascx
   --> Page_Load
          ---> initialize ourselves now that viewstate has been restored

then i begin to access my UserControl1 control before it is ready.

i need a way to run code after all Page_Load events have fired, but before any postback events (e.g. Click events) have fired:

MyPage.aspx
   --> Page_Load
UserControl1.ascx
   --> Page_Load
          ---> initialize ourselves now that viewstate has been restored
MyPage.aspx
   --> Page_AfterLoad
          ---> DoSomethingWithUserControl()

Looking at the page lifecycle in MSDN it looks like there is no way to raise an event after all Page_Loads have been completed:

enter image description here

Is there a way to raise an after after all Page_Loads have completed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:41:48+00:00Added an answer on June 6, 2026 at 12:41 pm

    Page_LoadComplete is the event that is raised after all controls have been loaded

    Remember that the Init event is first triggered by all child controls, and just when all controls have been initialized, the Init event of the page is raised. The Load event works the other way around, the page first raises the Load event and then each child control raises its own Load event. At the end the LoadComplete is raised. Note that this is true only when the controls are created at design time, when the controls are created dynamically they (sadly) do not follow this approach strictly.

    From MSDN:

    If controls are created dynamically at run time or declaratively within templates of data-bound controls, their events are initially not synchronized with those of other controls on the page. For example, for a control that is added at run time, the Init and Load events might occur much later in the page life cycle than the same events for controls created declaratively. Therefore, from the time that they are instantiated, dynamically added controls and controls in templates raise their events one after the other until they have caught up to the event during which it was added to the Controls collection.

    Take a look:

    (source: http://msdn.microsoft.com/en-us/library/ms178472.aspx)

    enter image description here

    Edit 1

    In order to fulfill all your requirements:

    i need a way to run code after all Page_Load events have fired, but before any postback events (e.g. Click events) have fired:

    I think the easiest way is to declare a custom event in the User Control and fire it after the control has been loaded, then jus subscribe to that event in your ASPX

    User Control

        public event Action LoadCompleted = delegate { };
    
        protected void Page_Load(object sender, EventArgs e)
        {
            this.LoadCompleted();
        }
    

    ASPX page

        protected void Page_Load(object sender, EventArgs e)
        {
            this.myUserControl.LoadCompleted += () => 
            {
                // do somethign interesting
                this.lblMessage.Text = DateTime.Now.ToString();
            };
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in wxpython, is there a event that can occur when one of the function
I have a JS routine (triggered by the user) that can take some time
Is there an event that is fired when the user presses the close button?
Is there an event that I can tap into in Global.asax to execute some
I have some code that adds mouseover events and mouseout events to all 'a'
Is there a way that I could trigger an onresize() event for my window
Is there any event that is fired when the idHttpServer disconnects? By disconnect I
Is there an event that fires in vb.net just before a contextMenuStrip appears when
Is there an event in WinForms that get's fired when a window is dragged?
There's a page that has a hover event defined inside the page script as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.