Click to See Complete Forum and Search --> : Page Redirect
Peter Czurak
May 1st, 2000, 04:27 AM
I have an ASP page that executes an ActiveX Dll which does database access. The process is lengthy (about 5 minutes). I added a progress bar, but this ActiveX dll (the progress bar) requires that the Response.Buffer to be set
to False, other wise you don't see the progress bar until my custom dll finishes the process - that's why I can't use Response.Redirect I get an error message if I do . At the end of the process I want to display another web page.
(I am running IIS4)
OmegaJunior
May 1st, 2000, 03:13 PM
Greetings,
Maybe you don't need to disable Response.Buffer if you try an other progress bar. Did you try client side JavaScript progress bars? I'm sure they can keep running no matter the Response.Buffer setting.
I guess, the crux here is using client side tools, whilst waiting for a server side event. Client side tools don't interfere with server side code (at least, they shouldn't).
Just pointing in a direction here... :)
OK, don't know if this will work with your project but here's a test project(this one doesn't use a progress bar but maybe you can hack the script to do it...) :
I created a dll that wastes time, literally. This is to somewhat simulate the amount of time your database component takes to do it's thing.
Right click and save the component from the following link if you want:
http://www.panteravb.com/data/Timer.dll
Project Type: dll
Project Name: Timer
Class Name: Wait
Option Explicit
Public Function Interval(ByVal intSeconds As Integer) As Boolean
Dim dtStopTime As Date
dtStopTime = DateAdd("s", intSeconds, Now)
Do While Now < dtStopTime
'nothing
Loop
Interval = True
End Function
you can also do this through vbscript in the asp page but i wanted to use a dll to more closely simulate your environment.
I'll list the code for the three files you need, one is the default.asp which accepts how long you want your process to take(i.e. how long you want to simulate your database functions take).
You submit to your splash page which has a meta tag redirect that sends your info to the processing page. So long as your processing page does not send any data back to the browser the splash page remains in the browser waiting for the next page to load.
default.asp
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<script language="javascript">
function Validate() {
var objForm = document.forms["test"]
if (objForm["interval"].value == ""){
alert ("Please enter the length of time you want the processing page \nto take before returning to the this page again.")
objForm["interval"].focus()
return false
}
return true
}
</script>
<form name="test" onsubmit="return Validate()" method="post" action="splash.asp">
<table cellpadding="0" cellspacing="0" border="0">
<% if trim(request("msg")) <> "" then %>
<tr>
<td align="left" colspan="2">
<FONT SIZE="2" FACE="arial, helvetica" color="#ff0000"><b><%= trim(request("msg")) %></b></font>
</td>
</tr>
<% end if %>
<tr>
<td>How long do you want the processing page to take?</td>
<td><input size="4" maxlength="2" type="text" name="interval" value=""></td>
</tr>
<tr>
<td><input type="submit" value=" Start Processing "></td>
<td>*</td>
</tr>
</table>
</form>
</BODY>
</HTML>
splash.asp
<meta http-equiv="Refresh" content="1; URL=xt_process.asa?interval=<%= trim(request("interval"))%>">
<html>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
<b>Please wait while we do some processing, this may be a few minutes...</b>
</body>
</html>
xt_process.asa
<%
Response.Buffer = true
dim objWait
set objWait = Server.CreateObject ("Timer.Wait")
objWait.Interval trim(request("interval"))
set objWait = nothing
Response.Redirect "default.asp?msg=" & server.URLEncode ("Processing Complete")
%>
Peter Czurak
May 7th, 2000, 11:42 PM
First of all I would like to thank you for all your time trying to help me. All though your solution does not work for my current problem I have some other projects that this solution will work.
The solution does not work on IE4. I get an error message "The Page Can Not Be Displayed" after few minutes. It works fine on IE5.01 and Netscape or if I lower the time to few seconds.
Thanks
Peter
pczurak@bigfoot.com
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.