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

  • SEARCH
  • Home
  • 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 7625287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:10:20+00:00 2026-05-31T05:10:20+00:00

I use LoadControl method in Load event quite extensively. However I haven’t observed any

  • 0

I use LoadControl method in Load event quite extensively. However I haven’t observed any problems yet, I’m afraid of what MSDN documentation says:

When you load a control into a container control, the container
raises all of the added control’s events until it has caught up to the
current event. However, the added control does not catch up with
postback data processing
. For an added control to participate in
postback data processing, including validation, the control must be
added in the Init event rather than in the Load event.

What does it actually mean?

Are there any other pitfalls when loading a control in the Load event?

  • 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-05-31T05:10:20+00:00Added an answer on May 31, 2026 at 5:10 am

    That bit of MSDN documentation is (mostly) wrong. As you’ve discovered, postback data processing and validation work even if you dynamically add controls in the Load event.

    Here are the stages of the ASP.NET page life cycle that are relevant to this question:

    1. Raise the Init event.
    2. Postbacks: Load view state and control state.
    3. Postbacks: Load posted form data (first attempt).
    4. Raise the Load event.
    5. Postbacks: Load posted form data (second attempt).
    6. Postbacks: Validate the form and raise the postback event.

    The documentation is correct when it says that “the added control does not catch up with postback data processing”. But it overlooks the fact that there are two attempts to load posted form data, once before the Load event and once after. Thus, if you dynamically add a control in the Load event, it will be populated with posted form data by the time the postback event (such as submitButton_Click) occurs.

    As far as I can tell, here’s the main difference and potential pitfall:

    • If you dynamically add a control in Init, you can access its posted form data in Load.
    • If you dynamically add a control in Load, you have to wait until the postback event (or else access the HttpRequest.Form collection directly).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

use javascript or other method ? have any recommendation?
When I use the following #include <map> using namespace LCDControl; Any reference to the
Use case: user clicks the link on a webpage - boom! load of files
We're using LoadControl to load an ascx file into a placeholder control dynamically. The
I’m adding web user controls to a page dynamically. Using the LoadControl method that
I load the content of some User Controls into my page with the use
I am loading a series of controls in the Page_Load event. However, I have
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
Use case: A does something on his box and gots stuck. He asks B
Use case: 3rd party application wants to programatically monitor a text file being generated

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.