Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP re-direct question...

Reply
Thread Tools

ASP re-direct question...

 
 
David
Guest
Posts: n/a
 
      10-21-2004
Hi,

I have an asp page which basically takes some data from a previous
page form and inserts the data to my database and then does a
re-direct to:

Response.Redirect "JS_Create.asp"

On this page is just an animated logo saying something like 'Loading
Data ....'

On this asp page JS_Create.asp I have another re-direct handled by a
timer to go to JobSheet.asp.

The idea is that the user enters data into the form, if the form is
validated correctly, they are transferred to the next page which tells
them the data is loading. They are held there for say 3 to 5 seconds
and then transferred to the final page JobSheet.asp.

The code I have on JS_Create.asp for the timed re-direct is:

___________________________

<%
Sub Delay(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>

later in the page I have:

<%
Delay(5)
Response.Redirect "JobSheet.asp"
%>

____________________

The problem is that once the form is submitted, the page does not
change to JS_Create.asp, it just sits there on the form for the 3 to 5
seconds and then jumps immediately to JobSheet.asp. I want
JS_Create.asp to be displayed first.

Where should I place the asp or change it for this to occur ?

Appreciate your help.


David
 
Reply With Quote
 
 
 
 
Larry Woods
Guest
Posts: n/a
 
      10-21-2004
Here's a way:

A couple of points... The writing of the spaces is a "fix" for IE. You
can't use the redirect because you have already sent headers back to the
browser via the "flush", which you need to get the "Waiting..." displayed.
The introduction of the javascript into the output stream takes care of
redirecting to the final page.

CODE:

<html><head/>

<%
' Sub Delay is NOT changed in any way from your original code.
Sub Delay(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>

<body>
Waiting...
</body>
<%
' spaces for IE
response.write space(256)
' makes sure that previous text is displayed
response.flush()
Delay(5)
' adds javascript to stream
response.write "<script
language=javascript>location.href='JobSheet.asp';</script>"
' following line of code can't be used...
'Response.Redirect "JobSheet.asp"
%>
</html>


"David" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> Hi,
>
> I have an asp page which basically takes some data from a previous
> page form and inserts the data to my database and then does a
> re-direct to:
>
> Response.Redirect "JS_Create.asp"
>
> On this page is just an animated logo saying something like 'Loading
> Data ....'
>
> On this asp page JS_Create.asp I have another re-direct handled by a
> timer to go to JobSheet.asp.
>
> The idea is that the user enters data into the form, if the form is
> validated correctly, they are transferred to the next page which tells
> them the data is loading. They are held there for say 3 to 5 seconds
> and then transferred to the final page JobSheet.asp.
>
> The code I have on JS_Create.asp for the timed re-direct is:
>
> ___________________________
>
> <%
> Sub Delay(DelaySeconds)
> SecCount = 0
> Sec2 = 0
> While SecCount < DelaySeconds + 1
> Sec1 = Second(Time())
> If Sec1 <> Sec2 Then
> Sec2 = Second(Time())
> SecCount = SecCount + 1
> End If
> Wend
> End Sub
> %>
>
> later in the page I have:
>
> <%
> Delay(5)
> Response.Redirect "JobSheet.asp"
> %>
>
> ____________________
>
> The problem is that once the form is submitted, the page does not
> change to JS_Create.asp, it just sits there on the form for the 3 to 5
> seconds and then jumps immediately to JobSheet.asp. I want
> JS_Create.asp to be displayed first.
>
> Where should I place the asp or change it for this to occur ?
>
> Appreciate your help.
>
>
> David



 
Reply With Quote
 
 
 
 
Larry Bud
Guest
Posts: n/a
 
      10-21-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (David) wrote in message news:<(E-Mail Removed) om>...
> Hi,
>
> I have an asp page which basically takes some data from a previous
> page form and inserts the data to my database and then does a
> re-direct to:
>
> Response.Redirect "JS_Create.asp"
>
> On this page is just an animated logo saying something like 'Loading
> Data ....'


Why in the world would you want to slow the user down by 5 seconds for
every data entry form?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
global filter to redirect asp (old asp!) pages on asp.net site Daves ASP .Net 2 05-31-2006 08:33 AM
2.0: asp:Menu, asp:XmlDataSource, asp:PlaceHolder R.A.M. ASP .Net 1 03-29-2006 07:55 AM
[ASP.NET1.1]Should I kill the ASP.NET worker process after recompilingmy ASP.NET webservice? Andrea Raimondi ASP .Net 1 02-06-2006 08:10 AM
ASP.Net cookie -> ASP -> ASP.Net Ben ASP .Net 3 05-28-2004 03:35 PM
LOOP through an ASP form's pages (not ASP.NET - ASP classic) David A. Beck ASP General 10 04-13-2004 05:38 PM



Advertisments