dhodgdon
Posts: 80
|
| Posted: 08/05/2004, 9:18 PM |
|
Does CCS have a built in function to delay a redirect?
If I have to build it, does anyone have sample code that will delay about five seconds before redirecting?
_________________
Regards,
David Hodgdon
|
 |
 |
DonB
|
| Posted: 08/06/2004, 5:48 AM |
|
No, CCS does not have a delay function. No development tool has one, in
fact. They do exist in the languages that these tools use. For example
Javascript has window.setTimeout().
You need to understand that the redirection is a client-side activity. The
server can only respond to the client (browser) command for redirection, so
there isn't anything you can do server-side to either initiate, or to delay,
the redirect. Now, you might be able to delay the page output in response
to the redirect, but (a) why bother? and (b) you're wasting the server's CPU
cycles if you do it.
Most browsers understand the following meta tag:
<META HTTP-EQUIV="REFRESH" CONTENT="5; URL=http://www.sample.com/next.htm">
This (when present in the header of a page) will send the browser to the
specified URL after 5 seconds (in this example). There are other javascript
techniques with SetTimeout() and a call to it in the page's onload event.
Sometimes, it's good to have both, in case one happens to NOT be supported
in a particular browser - redundancy in order to improve the chances the
redirect will work. In any case, you should always provide a clickable
redirect for those potential cases where the auto-redirect doesn't work as
intended.
--
DonB
logging at http://www.gotodon.com/ccbth, and blogging at http://ccbth.gotodon.net
"dhodgdon" <dhodgdon@forum.codecharge> wrote in message
news:6411306a6b1758@news.codecharge.com...
> Does CCS have a built in function to delay a redirect?
>
> If I have to build it, does anyone have sample code that will delay about
five
> seconds before redirecting?
> _________________
> ____________________
> David Hodgdon
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
navcan
Posts: 61
|
| Posted: 08/06/2004, 12:17 PM |
|
David,
I was also looking for similar kind of function. There is a free component available on http://www.serverobjects.com/products.htm. Name of the component is waitfor 1.0 , Using this component you can pause your ASP script for a specified time. I am using it in one of my project and it is working like a charm.
Hope this helps...
Regards,
navcan
|
 |
 |
dhodgdon
Posts: 80
|
| Posted: 08/06/2004, 1:09 PM |
|
Thanks to both!
_________________
Regards,
David Hodgdon
|
 |
 |
|