Home|Sitemap|Contact

How can you show a progress bar when you submit a form to an ASP page?


Please Wait While Your Data Is Submitted.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
<title>progess bar for long running database submission</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005, 2006 Roderick Divilbiss">
</head>

<body id="oBody">
Please Wait While Your Data Is Submitted.<br>
<img border="0" src="progressBar.gif" width="349" height="21">
</body>

</html>
<%
' force the progress bar to be written before
' running the time consuming database submission.
response.flush

Dim processedOK
processedOK = false


'**************************************
'* Process you form data here
'**************************************
' simulated with long loop.
Dim idx, i
for idx = 1 to 10000000
i = i + idx
next
'* pretend success
processedOK = true
'***************************************


if processedOK then
    server.transfer("progess_bar_finished.asp")
else
   server.transfer("progess_bar_error.asp")
end if 
%>