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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:49:44+00:00 2026-05-23T13:49:44+00:00

So I have a button and four labels in my .aspx page. When I

  • 0

So I have a button and four labels in my .aspx page. When I click the button I want the labels to be assigned text after sleeping for a few seconds each. However, I want them to post back on the page as they finish.

Ie. Label 3 takes 3 seconds to complete, Label 1 takes 5 seconds to complete, Label 2 takes 7 seconds to complete, Label 4 takes 12 seconds to complete.

So in the webpage, we see Label 3 appear, then Label 1 etc. Not all three coming back at the same time.

.cs

public string ProvincesAndSatesRetunServiceMethod()
{
    int min = 1000;
    int max = 10000;
    var rand = new Random();
    Stopwatch time = new Stopwatch();
    time.Start();
    System.Threading.Thread.Sleep(rand.Next(min, max));
    time.Stop();
    return " returned from method in " + time.Elapsed.Seconds + "seconds";
}
protected void PostAll_Click(object sender, EventArgs e)
{
    Label1.Text = ProvincesAndSatesRetunServiceMethod();
    Label2.Text = ProvincesAndSatesRetunServiceMethod();
    Label3.Text = "No Responese Received";
    Label4.Text = ProvincesAndSatesRetunServiceMethod();
}

.aspx

<%--IRE FAKING SERVICE --%>
<asp:UpdatePanel ID="testUpdatePanel" runat="server">
    <ContentTemplate>
        <asp:Button ID="btnAllPosts" runat="server" Text="Post All" onclick="PostAll_Click" autopostback="false" />
        <asp:Button ID="btnReset" runat="server" Text="Reset" onclick="btnReset_Click"  /><br />
        <asp:Label ID="Label1" runat="server" /><br />
        <asp:Label ID="Label2" runat="server"  /><br />
        <asp:Label ID="Label3" runat="server" /><br />
        <asp:Label ID="Label4" runat="server"  /><br />
    </ContentTemplate>
</asp:UpdatePanel>

Right now all labels post back at the same time on the page after all methods are finished running. I need this functionality in real life and in that case a servvice is called from several different networks and each network posts back information after they have finished computations. It is important to show these as they arrive since users are waiting for them to be finished and some can take up to five minutes.

This service is out of my control and cannot be changed.

Thank you in advance for any help! Sorry for the newb mistakes 🙂

EDIT: I have now been able to have this work in a WCF web service that is async. It works very well but in the AsyncCompleted method, it posts back after all threads have completed in parallel. I need them to appear inside the update panel on the .aspx page as the threads are finished. Any ideas on how to do this?

Thanks in advance.

  • 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-23T13:49:44+00:00Added an answer on May 23, 2026 at 1:49 pm

    If it’s not targeting tech-savvy users, you may accomplish this task simply by delaying on the client side instead of waiting (and consuming resources) on server-side. You may use simple javascript setTimeout or jQuery delay functions. Have a look, it may make your job much easier if that’s what you want — a fake waiting. But note that who is good with computers/knowing programming will notice what you are doing.

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

Sidebar

Related Questions

I have an aspx page with four UpdatePanels. Incidentally, each UpdatePanel corresponds to a
I have four buttons on my page <button id=opener >Submit Timecard</button> <button id=cancel class=cancel>Cancel</button>
I have a program with four different buttons. I want to interchange the position
I have one issue with UInavigationcontroller In my firstview i have button.If i click
I have a button on an ASP.Net page that will call Response.Redirect back to
I have two web pages: one consists of four asp.net text boxes and one
I have 4 button (b1,b2,b3,b4) and a label (lab).Now I want to display button
I have a button/link. I want to open multiple divs on multiple clicks on
I have four wheels which spin with the numbers 0-9: I want to be
I currently have a page with four list boxes on it and imagine a

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.