Visual Basic.NET
  Home arrow Visual Basic.NET arrow Executing Long-Running Tasks with the Prog...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Executing Long-Running Tasks with the Progress Bar in ASP.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 38
    2005-08-31

    Table of Contents:
  • Executing Long-Running Tasks with the Progress Bar in ASP.NET
  • The structure of the VS.NET solution
  • The long-running process (or task)
  • Showing the progress
  • What is “ProcessingStatus.vb” in detail?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Executing Long-Running Tasks with the Progress Bar in ASP.NET
    (Page 1 of 5 )

    This article demonstrates the use of multi-threading in ASP.NET web applications to execute long running tasks. It also shows the status of that long running task with the help of a progress bar.
    A downloadable file for this article is available here.

    The problem

    Every scenario in IT, at some level, needs a long running task (process) to be performed.  Long running tasks may also include taking a huge database backup, installing software, formatting a disk, and so on. When we perform any of those tasks, we will watch its progress. 

    When a lengthy task starts, some applications get developed with a simple message such as “Please wait” or “Wait a moment” or something similar. Some applications show the progress of the same type of task (sometimes in the form of “percentage complete” or “time remaining”). Showing the progress of a task is pretty common during installations of certain software (or even small packages).

    Any user would generally ask (or suggest) that we show the progress of achievement when the system starts processing a lengthy task.  If it is a small task (say, going to complete within one minute), it is reasonable to provide messages such as “Please Wait…” or “Wait a moment.”  But, for long running tasks, it is the programmer’s responsibility to show the progress of achievement to the user visually (before the user complains for it).

    It is fairly easy to show the progress of achievement (for long running tasks) on desktop (non–browser based) applications.  But, it is a bit difficult for browser based applications, because we will not be able to maintain a dedicated HTTP request.  Once the browser receives the information (response) from server, the HTTP connection gets disconnected automatically.  If the server takes too much  time to serve for the browser (or client) through HTTP, we may even experience a “Timeout” error.

    This article concentrates on working with long running tasks in ASP.NET effectively without consuming too many resources from the server (using multi-threading), and also showing the progress of the task to the user (by auto-refreshing the page every two seconds).

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Thanx a lot for this. I've always thought that multithreading is only useful for...
       · Hello,The article is just only to give you an idea of implementing the progress...
       · You can still further discuss, if you have doubts. I am here to answer you.
       · Any thoughts on how this might be applied to file uploads? It seems like the...
       · You might use the concept of "streaming the binary content" for your requirement. I...
       · Hi, Thanks for sharing this code. My question is how is the 'requestId' got removed...
       · Good catch! Even I never thought of it. Right now, I could not think of very good...
       · I copied and run the code in my machine and getting "ProcessingStatus not defined"...
       · Have you had any further thoughts on "how is the 'requestId' got removed in case...
       · Hi thereI'm trying to use your example but the doprocess is not starting and...
       · Hi,I'm also using your technique to show progress, however i'm concerned about...
     

    VISUAL BASIC.NET ARTICLES

    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway