ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   One for you .asp or java boys (https://www.scoobynet.com/computer-and-technology-related-34/208816-one-for-you-asp-or-java-boys.html)

Ga22ar 13 May 2003 08:19 PM

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

IWatkins 13 May 2003 09:05 PM

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]


All times are GMT +1. The time now is 02:48 PM.


© 2024 MH Sub I, LLC dba Internet Brands