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 13 May 2003, 08:19 PM
  #1  
Ga22ar
Scooby Regular
Thread Starter
 
Ga22ar's Avatar
 
Join Date: Dec 2001
Posts: 436
Likes: 0
Received 0 Likes on 0 Posts
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
Old 13 May 2003, 09:05 PM
  #2  
IWatkins
Scooby Regular
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
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]
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
garethscott
General Technical
63
26 November 2015 02:42 PM
SwissTony
Member's Gallery
4
21 September 2015 10:26 AM
harj
ScoobyNet General
25
13 September 2000 03:48 PM
Neil Smalley
ScoobyNet General
1
10 September 2000 11:09 PM
Maverick
ScoobyNet General
19
11 May 2000 12:10 PM



Quick Reply: One for you .asp or java boys



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