locked
Bulk Update with status RRS feed

  • Question

  • User2065288525 posted

    Hi All

    Lets say i have a button control on a page and a label control....

    On clicking this button it performs series of actions say Action 1 , Action 2.......Action 20 which will take say approx 1 hour to complete.

    What i need is, once this long processing is started, My web page should show the status of each action on label.  Eg.  After clicking a button, Label1 text should be  "Action 1 is started" 

    after Action1 is completed and Action 2 is started ,.... Label1 text should be "Action 1 Done...Action 2 started"

    I need this so that my user can see whats the current state of processing.

    How can i do this ?





    Tuesday, January 12, 2010 12:17 PM

Answers

All replies

  • User2130758966 posted

    If you need to execute a procedure that long then you need to make a windows service to run it.

    Its not that hard to write a windows service but you will need a dedicated server as your host, you can't usually install services with shared hosting...

    Tuesday, January 12, 2010 1:20 PM
  • User2065288525 posted

    yes i understand this.

    Lets talk in general. I just want to run a series of actions(it can be any) on button click. and i need to update its status on web page in a label so that user is aware of at what exceution point is the current process.

    Is there not any way i can send back a string message after completing Action1 ?

    Tuesday, January 12, 2010 1:52 PM
  • User-952121411 posted

    The most basic issue with this visual update on the surface is the very nature of how the client and server relationship works.  See once the client clicks a button, a call is made to the server to begin that process (in IE or similar browser you see the little indicator bar progress at the bottom of the page, showing that processing is occurring).  At this point the UI can not be updated until the server has finished processing, and a new page is sent back to the client to be rendered.

    So you see unlike a Win Forms application where it is really easy to have a delegate during a long process raise an event to Update the UI, it does not have this same ability in a client server web application.  You will not be able to update your client's web page until the server has finished processing and a new page can be rendered. 

    You may have seen web upload controls before with upload progress bars.  Ever notice how they flicker each time the % upload complete, or progress bar value is updated?  That is because the form is posting back and a new page is rendered on the client.  Sure there are ways to do an async postback to mask the flickering, but in a nutshell, each time you want to update a % complete or progress bar, a new page or partial part of the page is going to have to be re-rendered on the client. 

    The you have the issue of trying to click multiple buttons on a web form a once.  That is not going to happen.  If you press a second button while the 1st is still processing on the server, the new request is queued and not even processed until the 1st call has completed.  If you really want multiple processes to work on the server at once, you are going to need to have the client initiate this from (1) button click or action, and then spawn an asynchronous process on the server.  From here you could return processing to the client while the server is still processing, and possibly check in on the processes running on the server and read some value indicating how far along the process is, and then begin updating the UI via a percentage complete or progress bar.

    If these are truly long running processes, then maybe you do have the client flag the database to have a task done, and then have a Windows Service or similar design work the process in the background.  If the process does not really run that long, and there are a lot of them to do, but you need your client to see the progress, then you need to yield to the descriptions given above to know what constraints you face when dealing with this on the web.

    Hope this helps! Smile

    Tuesday, January 12, 2010 3:23 PM
  • User2065288525 posted


    Check above image. This is a screen-shot of one open source application called SMF.  It shows the process and its status according to completion of actions as seen above. This over the web.  I am sure its possible to do in asp.net too.


    Any  help on how to do this in asp.net will surely help me as i need to implement it.

    Wednesday, January 13, 2010 8:37 AM
  • User2065288525 posted


    Check above image. This is a screen-shot of one open source application called SMF.  It shows the process and its status according to completion of actions as seen above. This over the web.  I am sure its possible to do in asp.net too.


    Any  help on how to do this in asp.net will surely help me as i need to implement it.

    Wednesday, January 13, 2010 8:39 AM
  • User-952121411 posted

    Ok with the attached image I see a single process is launched that then goes through multiple steps (not multiple clicks as I may have misunderstood before).  The status bars could be updated by checking their progress and then updating the client's page through asynchronous postbacks.  The 1st thing that comes to mind is an AJAX Update Panel.  It would be easy to check the status via an asynchronous postback and then update the UI accordingly.  This would prevent any full post back flickering as I had mentioned before. 

    You may want to take a look at the following links:

    ASP.NET AJAX Progress Bar Control:

    http://mattberseth.com/blog/2008/05/aspnet_ajax_progress_bar_contr.html

    Real-Time Progress Bar With ASP.NET AJAX:

    http://www.singingeels.com/Articles/RealTime_Progress_Bar_With_ASPNET_AJAX.aspx

    ASP.Net - AJAX with Continuous Progress Bar:

    http://www.dreamincode.net/forums/showtopic119029.htm

    How to create ProgressBar user control:

    http://www.beansoftware.com/ASP.NET-Tutorials/ProgressBar-User-Control.aspx

    Executing Long-Running Tasks with the Progress Bar in ASP.NET:

    http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 13, 2010 8:59 AM
  • User2065288525 posted

    gr888 thanks a lot for those links. I am going through it and will mark as answer after reading those links.


    Thanks again.

    Thursday, January 14, 2010 12:37 AM