Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

One for you .asp or java boys

Thread Tools
 
Search this Thread
 
Old May 13, 2003 | 08:19 PM
  #1  
Ga22ar's Avatar
Ga22ar
Thread Starter
Scooby Regular
20 Year Member
 
Joined: Dec 2001
Posts: 436
Likes: 0
Post

OK this is what I want to do..

I have a asp page that executes on the server and punts out the results to a web page on a clients browser.. The asp page takes some time to execute so currently the client browser reports the start of the processing and then the result after a lengthy wait..

So what i want to do is to have a real time progress bar on the client browser relaying how far in percent the asp process is along.

Can this be done, is it simple, quick, easy ?

I'm only interested on this working on IE 5+ and i dont want to have any components required on the client or server end if poss..

cheers if you can help
Reply
Old May 13, 2003 | 09:05 PM
  #2  
IWatkins's Avatar
IWatkins
Scooby Regular
 
Joined: Mar 2000
Posts: 4,531
Likes: 0
From: Gloucestershire, home of the lawnmower.
Post

Don't know about ASP or JAVA but can certainly be done if you build an ISAPI application (I use Delphi).

However, I do not think it is specific to ISAPI so I'm guessing it can be done in ASP.

The way I do it is to "hold" the connection open and send progress info back to the browser as the job progresses. OK, I have it just as text that appears to say "20% Complete" etc. but with that you could easily bang together a progress bar built up using static image files.

By holding it open I mean as soon as the request comes in, you start to send progress info back straight away. Normally, the browser would just wait until you send a whole page back.

I don't know if any of the following will help you, but here is a little bit of Delphi that might help, or at least point you in the right direction:

Request Routine

begin
// Force browser to start listening as soon as request comes in
Response.SendResponse;

// Start sending stuff back straight away. Create top of document
MyStr := '<HTML><HEAD><HEAD><BODY>' ;

// Write it to waiting browser
Request.WriteString(MyStr);

// Start the main progressing
// Output that we are at 20%
MyStr := '20% Complete<BR>';
Request.WriteString(MyStr);

{Lots of processing in here that takes time}

// Output that we are at 40%
MyStr := '40% Complete<BR>';
Request.WriteString(MyStr);

{Lots of processing in here that takes time}

// Output that we are at 60%
MyStr := '60% Complete<BR>';
Request.WriteString(MyStr);

{Lots of processing in here that takes time}

// Output that we are at 80%
MyStr := '80% Complete<BR>';
Request.WriteString(MyStr);

{Lots of processing in here that takes time}

// Output that we are at 100%
MyStr := '100% Complete<BR>';
Request.WriteString(MyStr);

// OK, we are done, finish the document
MyStr := '</BODY></HTML>';
Request.WriteString(MyStr);
end;

I.e you are always dribbling the response back to the browser during the processing rather than just sending one bit page after processing.

Cheers

Ian





[Edited by IWatkins - 5/13/2003 9:07:12 PM]
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
garethscott
General Technical
63
Nov 26, 2015 02:42 PM
SwissTony
Member's Gallery
4
Sep 21, 2015 10:26 AM
harj
ScoobyNet General
25
Sep 13, 2000 03:48 PM
Neil Smalley
ScoobyNet General
1
Sep 10, 2000 11:09 PM
Maverick
ScoobyNet General
19
May 11, 2000 12:10 PM




All times are GMT +1. The time now is 09:06 AM.