Delaying on server side

A

Agoston Bejo

Hi,
I would like to achieve the equivalent of META REFRESH but without the HTML
meta refresh and without JavaScript. In other words, on server side I would
like to wait some seconds, then redirect the page. Is there any way to do
this?
 
E

Evertjan.

Agoston Bejo wrote on 14 feb 2005 in
microsoft.public.inetserver.asp.general:
I would like to achieve the equivalent of META REFRESH but without the
HTML meta refresh and without JavaScript. In other words, on server
side I would like to wait some seconds, then redirect the page. Is
there any way to do this?

No, redirecting is always clientside.

even serverside response.redirect "/"

Cannot be sent after any html is sent, as it
simply sets a redirect header in the message to the client.
 
B

Bob Barrows [MVP]

Agoston said:
Hi,
I would like to achieve the equivalent of META REFRESH but without
the HTML meta refresh and without JavaScript. In other words, on
server side I would like to wait some seconds, then redirect the
page. Is there any way to do this?

You can use server.transfer to accomplish the client-less redirect, but
making the server wait without causing 100% CPU usage (definitely not
recommended) is not possible. Web servers are designed to serve requests,
not sit there waiting, refusing pending requests as it waits..

Bob Barrows
 
R

Roland Hall

: Hi,
: I would like to achieve the equivalent of META REFRESH but without the
HTML
: meta refresh and without JavaScript. In other words, on server side I
would
: like to wait some seconds, then redirect the page. Is there any way to do
: this?

Why? What is wrong with those two options?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
A

Agoston Bejo

Roland Hall said:
: Hi,
: I would like to achieve the equivalent of META REFRESH but without the
HTML
: meta refresh and without JavaScript. In other words, on server side I
would
: like to wait some seconds, then redirect the page. Is there any way to do
: this?

Why? What is wrong with those two options?

The <meta refresh> method is not recommended by the World Wide Web
consortium (see http://www.w3schools.com/html/html_meta.asp).

The JavaScript method requires the client to enable JavaScript (which is
quite a reasonable expectation, but why require it if not neccessary?).

Actually I used <meta refresh> at the end.

Agoston.
 
R

Roland Hall

:
: : > : > : Hi,
: > : I would like to achieve the equivalent of META REFRESH but without the
: > HTML
: > : meta refresh and without JavaScript. In other words, on server side I
: > would
: > : like to wait some seconds, then redirect the page. Is there any way to
: do
: > : this?
: >
: > Why? What is wrong with those two options?
:
: The <meta refresh> method is not recommended by the World Wide Web
: consortium (see http://www.w3schools.com/html/html_meta.asp).
:
: The JavaScript method requires the client to enable JavaScript (which is
: quite a reasonable expectation, but why require it if not neccessary?).
:
: Actually I used <meta refresh> at the end.

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
Response.AddHeader "Refresh","5;URL=http://domain.com/someotherpage.asp"
Response.Write "Redirecting in 5 seconds..."
%>

http://kiddanger.com/lab/delayedredirect.asp

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
E

Evertjan.

Roland Hall wrote on 15 feb 2005 in
microsoft.public.inetserver.asp.general:
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
Response.AddHeader "Refresh","5;URL=http://domain.com/someotherpage.asp"
Response.Write "Redirecting in 5 seconds..."
%>

Awesome !! Why didn't I know that?

btw: why the Option Explicit?
 
R

Roland Hall

in message : Roland Hall wrote on 15 feb 2005 in
: microsoft.public.inetserver.asp.general:
:
: > <%@ Language=VBScript %>
: > <%
: > Option Explicit
: > Response.Buffer = True
: > Response.AddHeader "Refresh","5;URL=http://domain.com/someotherpage.asp"
: > Response.Write "Redirecting in 5 seconds..."
: > %>
: >
:
: Awesome !! Why didn't I know that?

I give up.

: btw: why the Option Explicit?

Sorry, habit.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
E

Evertjan.

Roland Hall wrote on 15 feb 2005 in
microsoft.public.inetserver.asp.general:
in message
: Roland Hall wrote on 15 feb 2005 in
: microsoft.public.inetserver.asp.general:
:
: > <%@ Language=VBScript %>
: > <%
: > Option Explicit
: > Response.Buffer = True
: > Response.AddHeader
: > "Refresh","5;URL=http://domain.com/someotherpage.asp"
: > Response.Write "Redirecting in 5 seconds..." %>
: >
:
: Awesome !! Why didn't I know that?

I give up.

I was serious !! I didn't know this as a header.

[and I am seldom serious]

I will contemplate about converting my pages that have metas.
 
R

Roland Hall

: Roland Hall wrote on 15 feb 2005 in
: microsoft.public.inetserver.asp.general:
:
: > "Evertjan." wrote in message
: > : >: Roland Hall wrote on 15 feb 2005 in
: >: microsoft.public.inetserver.asp.general:
: >:
: >: > <%@ Language=VBScript %>
: >: > <%
: >: > Option Explicit
: >: > Response.Buffer = True
: >: > Response.AddHeader
: >: > "Refresh","5;URL=http://domain.com/someotherpage.asp"
: >: > Response.Write "Redirecting in 5 seconds..." %>
: >: >
: >:
: >: Awesome !! Why didn't I know that?
: >
: > I give up.
: >
:
: I was serious !! I didn't know this as a header.

I know you were and so was I. I have no idea why you didn't know it. I've
never seen it done before either. The only issue here, as I am buffering is
dealing with Response.Flush where AddHeader can actually be anywhere in the
page when buffering but it has to come before a Flush. I call it the toilet
function. You can change your content but once you flush, that's it!

: [and I am seldom serious]

No reason to be serious here. (O:=

:
: I will contemplate about converting my pages that have metas.

After reading the W3C re: META refresh, I never found a difinitive reason
why it should not be used. It said, "some browsers may not be able to use
it". Well, that's clear as mud. Which browsers and is this still relative
or is it just because the client cannot be controlled?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
M

Michael D. Kersey

Roland Hall wrote:
: I will contemplate about converting my pages that have metas.

After reading the W3C re: META refresh, I never found a difinitive reason
why it should not be used. It said, "some browsers may not be able to use
it". Well, that's clear as mud. Which browsers and is this still relative
or is it just because the client cannot be controlled?

Most sites that use META refresh also provide a separate URL on the page
with text such as "If you are not redirected to a new page in 5 seconds,
then click _here_."

I don't hesitate to use META refresh but always also provide the
click-through URL. One reason is that, if the user hits the <esc> key
before the refresh occurs, then the URL won't change. <esc> (and
possibly other keys) kills the refresh; the click-through lets the user
recover.
 
A

Adrienne

Roland Hall wrote:


Most sites that use META refresh also provide a separate URL on the
page with text such as "If you are not redirected to a new page in 5
seconds, then click _here_."

I don't hesitate to use META refresh but always also provide the
click-through URL. One reason is that, if the user hits the <esc> key
before the refresh occurs, then the URL won't change. <esc> (and
possibly other keys) kills the refresh; the click-through lets the user
recover.

Additionally, one can set one's browser to disallow redirection.
 
R

Roland Hall

in message
: Gazing into my crystal ball I observed "Michael D. Kersey"
: <[email protected]> writing in
: :
: > Roland Hall wrote:
: ><snipped>
: >
: >> : I will contemplate about converting my pages that have metas.
: >>
: >> After reading the W3C re: META refresh, I never found a difinitive
: >> reason why it should not be used. It said, "some browsers may not be
: >> able to use it". Well, that's clear as mud. Which browsers and is
: >> this still relative or is it just because the client cannot be
: >> controlled?
: >
: > Most sites that use META refresh also provide a separate URL on the
: > page with text such as "If you are not redirected to a new page in 5
: > seconds, then click _here_."
: >
: > I don't hesitate to use META refresh but always also provide the
: > click-through URL. One reason is that, if the user hits the <esc> key
: > before the refresh occurs, then the URL won't change. <esc> (and
: > possibly other keys) kills the refresh; the click-through lets the user
: > recover.
: >
:
: Additionally, one can set one's browser to disallow redirection.

Are you referring to client-side redirection?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
A

Adrienne

in message
: Gazing into my crystal ball I observed "Michael D. Kersey"
: <[email protected]> writing in
: :
: > Roland Hall wrote: <snipped>
: >
: >> : I will contemplate about converting my pages that have metas.
: >>
: >> After reading the W3C re: META refresh, I never found a difinitive
: >> reason why it should not be used. It said, "some browsers may not
: >> be able to use it". Well, that's clear as mud. Which browsers and
: >> is this still relative or is it just because the client cannot be
: >> controlled?
: >
: > Most sites that use META refresh also provide a separate URL on the
: > page with text such as "If you are not redirected to a new page in 5
: > seconds, then click _here_."
: >
: > I don't hesitate to use META refresh but always also provide the
: > click-through URL. One reason is that, if the user hits the <esc>
: > key before the refresh occurs, then the URL won't change. <esc> (and
: > possibly other keys) kills the refresh; the click-through lets the
: > user recover.
: >
:
: Additionally, one can set one's browser to disallow redirection.

Are you referring to client-side redirection?

Nope, both client side and server side.

Opera preferences lets you disable automatic redirection. For client side,
it just sits there, for server side, you get Object Moved - Page is
available here (with a link to the new page).
 
E

Evertjan.

Adrienne wrote on 22 feb 2005 in microsoft.public.inetserver.asp.general:
Nope, both client side and server side.

There is NO serverside redirection!!!

[asp] response.redirect "/"

just sends a header asking the browser to redirect.

[asp Server.transfer should not be called redirecting]
 
I

Iain Norman

Roland Hall wrote:


Most sites that use META refresh also provide a separate URL on the page
with text such as "If you are not redirected to a new page in 5 seconds,
then click _here_."

I don't hesitate to use META refresh but always also provide the
click-through URL. One reason is that, if the user hits the <esc> key
before the refresh occurs, then the URL won't change. <esc> (and
possibly other keys) kills the refresh; the click-through lets the user
recover.

Search engines won't thank you for a meta refresh keep in mind though.
 
R

Roland Hall

in message
: Gazing into my crystal ball I observed Iain Norman <[email protected]>
: writing in :
: > Search engines won't thank you for a meta refresh keep in mind though.
: >
:
: They don't like a response.redirect either

Is there anything they do like? Better yet, is there anything they do like
today they will like tomorrow? When did it become fashionable to control
the layout/design of the sites of others?

Why is it, "don't do that....because...._______________.... doesn't like it"
rather than, "___________ doesn't know how to work with your site when you
do that. Let's look at a way to make it work so you can do it like that."

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
R

Roland Hall

: Adrienne wrote on 22 feb 2005 in microsoft.public.inetserver.asp.general:
:
: >>: Additionally, one can set one's browser to disallow redirection.
: >>
: >> Are you referring to client-side redirection?
: >>
: >
: > Nope, both client side and server side.
: >
:
: There is NO serverside redirection!!!
:
: [asp] response.redirect "/"
:
: just sends a header asking the browser to redirect.
:
: [asp Server.transfer should not be called redirecting]

Are you spanking the thread? (O:=

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
A

Adrienne

in message
: Gazing into my crystal ball I observed Iain Norman <[email protected]>
: writing in :
: > Search engines won't thank you for a meta refresh keep in mind
: > though.
: >
:
: They don't like a response.redirect either

Is there anything they do like? Better yet, is there anything they do
like today they will like tomorrow? When did it become fashionable to
control the layout/design of the sites of others?

Why is it, "don't do that....because...._______________.... doesn't
like it" rather than, "___________ doesn't know how to work with your
site when you do that. Let's look at a way to make it work so you can
do it like that."

They don't like presentational markup either, no I should say they prefer
well formed Strict documents.

Move the presenational stuff to external stylesheets, and javascript
enhancements to external scripts, use tables for tabular data, and they
seem to gobble it up.

I don't do anything else (doorways pages, hidden text, etc) and I have
always had good SERPs. I had one client that was #1 in Google for a year
and a half, until they decided to put back the presenational stuff, and now
they're off the map entirely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top