Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh ASP page as it posts..........

Status
Not open for further replies.

qberta01

Programmer
Nov 14, 2005
113
Hello,

If I have 2 ASP pages:

Main.asp
process.asp

Here is the process:

1. Click button on Main.asp
2. Execute VB6 exe on process.asp (long task).
3. The vb6 executable in turn updates a status field in
a SQL table.
4. Refresh main.asp through code in order to check that
status field.

I have used a different technique to get what I want, but
since I was "directed" to do it as outlined in the process I was wondering if it's possible to refresh a page as it's being posted? It didn't seem to work for me, but maybe I
missed a step.

Thx in advance,

Q
 
If your posting from the first page to the second page, the user is going to sit there and wait for the second page to finish processing.
If you can somehow launch that applicaiton asynchronously, then you will be able to response.redirect the user back to the main page and create some sort of refresh (client-side) to refresh occasionally.

On the other hand, if you cannot run the VB6 app asynchronusly, then you could cheat a little and use Javascript to call back to the server to initiate the application, as well as return status messages.
Basically instead of posting the form, use an XMLHTTP object to send the form data to the process.asp page. Then create a setInterval() call to regularly call a second function that uses XMLHTTP to occasionally call a status.asp page that would return just some raw status information. When you get the status back to your javascript page, it is a simple matter to push that value into a DIV on your page, or do something graphically in response to the status.
When the status reaches whatever endpoint status you have defined, you would want to clearInterval() the handle returned from setInterval() and redirect to any kind of completion page you might have.

This is basically AJAX, you can find more info all over the web, in the javascript forum, and in the AJAX forum if your interested in pursuing it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top