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 1019625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:02:34+00:00 2026-05-16T11:02:34+00:00

I have a page that has 3 used controls that are dynamically added to

  • 0

I have a page that has 3 used controls that are dynamically added to the page. One of these use controls hits a class that pulls a record set from the database (a rather quick request) and the other 2 user controls hit a single class and return a dataset from the database. The 2 that share a single class take an average of 10 seconds to return the data. Now what I want is for a user to hit the page and see 3 loading bars and have each user control load in the background. I want them all to start loading at the same time.

I have tried to call threading on the page containing the user controls like this:

 protected void Page_Load(object sender, EventArgs e)
{       
    Thread t = new Thread(new ThreadStart(Load1));
    t.Start();
    t.IsBackground = true;
    t.Priority = ThreadPriority.Highest;
    t.Join();

    Thread s = new Thread(new ThreadStart(Load2));
    s.Start();
    s.IsBackground = true;
    s.Priority = ThreadPriority.Highest;
    s.Join();

    Thread r = new Thread(new ThreadStart(Load3));
    r.Start();
    r.IsBackground = true;
    r.Priority = ThreadPriority.Highest;
    r.Join();
}

private void Load1()
{
    Control ctrl1 = LoadControl(@"\Controls\ctrl1.ascx");
    Pnl1.Controls.Add(ctrlPreSolic);
}

private void Load2()
{
    Control ctrl2 = LoadControl(@"\Controls\ctrl2.ascx");
    Pnl2.Controls.Add(ctrlActive);
}

private void Load3()
{
    Control ctrl3 = LoadControl(@"\Controls\ctrl3.ascx");
    Pnl3.Controls.Add(ctrlNonActive);
}

however this is not working, it is always loading the first control, then the second, then the third in a line not all at the same time. Is this the wrong way to approach a web application? Can you thread a web application? I really need help with this if anyone can help me out!

  • 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-16T11:02:34+00:00Added an answer on May 16, 2026 at 11:02 am

    Using threads like you do, is definitely not the way to load web controls asynchronously.

    If you insist on your approach, all the threads should join only afterwards, else each will block the execution, and effectively eliminate any multithreading advantages you tried to gain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that has an iframe From one of the pages within
I have a login page that has several textboxes on the page, one of
I have a page base class that has no .aspx file and so I
I have a Page that has a single instance of a UserControl that itself
In a web application, I have a page that contains a DIV that has
We have a page that ordinarily has two elements arranged side-by-side. Despite exploring a
On my C# asp.net webform I have a search page that has roughly 20
I have an XHTML strict page that has an invisible div that is controlled
If I have a control on a page that has its Datasource set to
I have a page with a Google Maps mashup that has pushpins that are

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.