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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:42:48+00:00 2026-05-21T22:42:48+00:00

I’m trying to add a realtime progress report to my c#/asp.net 4.0 application for

  • 0

I’m trying to add a realtime progress report to my c#/asp.net 4.0 application for a slow loading page. I’ve look at the UpdatePanel and UpdateProgress Ajax controls but I don’t think they’re suitable.

Basically when the user click a button the page executes a number of tasks, I’d like the user to see an update as each one completes, instead of a report when they all complete and the page load completes.

The order thing would happen would be:
1. user click button to start
2. call method 1
3. when method 1 completes, user see “Method 1 done”
3. call method 2
etc.

Can anyone help with this?

  • 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-21T22:42:49+00:00Added an answer on May 21, 2026 at 10:42 pm

    This sort of asynchronous execution can be difficult to implement. A few solutions off the top of my head:

    Totally asynchronous without AJAX:

    1. Use hits button, submits page.
    2. Server generates a GUID for the task, and creates a record in your database. This might include:

      • Guid (ID)
      • Status flag/enum
      • start time.
    3. Server spawns a thread to handle the task and passes in the Guid.

    4. Server returns the GUID, along with a “Working…” message
    5. After n seconds/milliseconds/insert-time-span-here, browser posts the page again, including a “GetStatus” command and the GUID.
    6. Server checks the status flag in the database based on the GUID.
    7. Server returns a status message based on the DB record (“Step 2…”, “Still working”, or whatever is appropriate)
    8. Loop to step (5) until the status returned from the server indicates that the process is complete.

    In the thread created in step (3):

    1. Thread start
    2. Read current status from the DB record
    3. Execute the next step based on that status
    4. Update the DB status to indicate that it’s ready to do the next step, or set an error flag.
    5. Sleep for a few milliseconds to keep from blocking the app (might be unnecessary – I’m not sure how threads interact under IIS)
    6. Loop to (2) until everything’s done.
    7. Thread exits.

    Here’s an example of easily creating a thread with a lambda.

    (new Thread(
        () => {
            DoLongRunningWork();
        }
    ) { Name = "Long Running Work Thread"
        ,
        Priority = ThreadPriority.BelowNormal 
        }).Start();
    

    Synchronous

    Easier, but might cause some performance problems:

    1. User submits “Start” form.
    2. Server writes “Starting…” to the response stream and flushes the stream. This should get the text back to the client, I think, but I haven’t tried it in years.
    3. Server executes first step.
    4. Server writes status to the response stream and flushes.
    5. Loop to step (3) until complete.

    Effectively, the page keeps the connection open until the task is complete, and flushing the output periodically keeps the client from timing out. This may have problems with timeouts, etc, and your server configuration (output buffering, etc) might be an issue.

    Background Task

    Similar to the first asynchronous approach:

    1. User clicks “start”
    2. Server adds a row to the DB that identifies the task to be executed, retrieves the ID, and returns it to the client.
    3. Create a scheduled task (script, windows service, etc) that polls the table, executes the desired tasks and updates the status as it progresses.
    4. Client re-posts the form with the DB ID periodically. Server checks the ID against the DB and returns a message about the status (may include info about previous steps such as exec time, ETA, etc)
    5. Client Loops to (4) until the task is complete or errors out.

    The difference between this and the first approach is that the thread lives in a separate process instead of IIS.

    Each approach has its issues, of course, and there may be a simpler way to do this.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.