Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Response.redirect


Message #1 by "Simon Garstin" <sales@o...> on Sat, 8 Dec 2001 12:27:05 -0000
Hi,



the reason for the recent 404 file question:



suppose a response.redirect command does not work because the web page does

not exist or the destination server is down - is there any way to stay

within the asp page and do something else eg.



<fictitious code>

if not response.redirect "http://www.somesite.com/somepage.htm" then

    <do something else>

end if

</fictitious code>







Simon Garstin



Message #2 by "Ken Schaefer" <ken@a...> on Sun, 9 Dec 2001 14:22:13 +1100
You will need a component to do a HTTP GET request for the page on the 2nd

server. If the HTTP Response is 200 OK, then you execute the redirect.



If the HTTP response is 404 (File Not Found), or if there is no HTTP

response (the server is not available, or able to respond), then you do

Response.Redirect



Look into using the Microsoft ServerXMLHTTP component to do this for you.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Simon Garstin" <sales@o...>

Subject: [asp_web_howto] Response.redirect





: the reason for the recent 404 file question:

:

: suppose a response.redirect command does not work because the web page

does

: not exist or the destination server is down - is there any way to stay

: within the asp page and do something else eg.

:

: <fictitious code>

: if not response.redirect "http://www.somesite.com/somepage.htm" then

:     <do something else>

: end if

: </fictitious code>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #3 by Mark Eckeard <meckeard2000@y...> on Sat, 8 Dec 2001 21:31:06 -0800 (PST)
You could even use the filesystemobject (fso) in a

function to see if the file exists.  Just pass the

file name to the function.  If it comes back true, the

page exists.  Something like this:



<%

 If FileExists("gothere.asp") then

   response.redirect

 else

   do something

 end if

%>



Mark



--- Ken Schaefer <ken@a...> wrote:

> You will need a component to do a HTTP GET request

> for the page on the 2nd

> server. If the HTTP Response is 200 OK, then you

> execute the redirect.

> 

> If the HTTP response is 404 (File Not Found), or if

> there is no HTTP

> response (the server is not available, or able to

> respond), then you do

> Response.Redirect

> 

> Look into using the Microsoft ServerXMLHTTP

> component to do this for you.

> 

> Cheers

> Ken

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> From: "Simon Garstin" <sales@o...>

> Subject: [asp_web_howto] Response.redirect

> 

> 

> : the reason for the recent 404 file question:

> :

> : suppose a response.redirect command does not work

> because the web page

> does

> : not exist or the destination server is down - is

> there any way to stay

> : within the asp page and do something else eg.

> :

> : <fictitious code>

> : if not response.redirect

> "http://www.somesite.com/somepage.htm" then

> :     <do something else>

> : end if

> : </fictitious code>

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> 

> 





$subst('Email.Unsub').





__________________________________________________

Do You Yahoo!?

Send your FREE holiday greetings online!

http://greetings.yahoo.com

Message #4 by "Vincent Vandermeeren" <vincent@v...> on Sun, 9 Dec 2001 10:14:10 +0100
Thanks for the info Ken !!

I knowed it could be donne but i didn't knew how.



Rhanks,

Vinnie



----- Original Message -----

From: Ken Schaefer <ken@a...>

To: ASP Web HowTo <asp_web_howto@p...>

Sent: Sunday, December 09, 2001 4:22 AM

Subject: [asp_web_howto] Re: Response.redirect





> You will need a component to do a HTTP GET request for the page on the 2nd

> server. If the HTTP Response is 200 OK, then you execute the redirect.

>

> If the HTTP response is 404 (File Not Found), or if there is no HTTP

> response (the server is not available, or able to respond), then you do

> Response.Redirect

>

> Look into using the Microsoft ServerXMLHTTP component to do this for you.

>

> Cheers

> Ken

>

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> From: "Simon Garstin" <sales@o...>

> Subject: [asp_web_howto] Response.redirect

>

>

> : the reason for the recent 404 file question:

> :

> : suppose a response.redirect command does not work because the web page

> does

> : not exist or the destination server is down - is there any way to stay

> : within the asp page and do something else eg.

> :

> : <fictitious code>

> : if not response.redirect "http://www.somesite.com/somepage.htm" then

> :     <do something else>

> : end if

> : </fictitious code>

>

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>

>




$subst('Email.Unsub').

>



Message #5 by "Simon Garstin" <sales@o...> on Mon, 10 Dec 2001 09:55:40 -0000
Mark,



I tried that but it only works for files on the local server.



Simon



----- Original Message -----

From: Mark Eckeard <meckeard2000@y...>

To: ASP Web HowTo <asp_web_howto@p...>

Sent: Sunday, December 09, 2001 5:31 AM

Subject: [asp_web_howto] Re: Response.redirect





> You could even use the filesystemobject (fso) in a

> function to see if the file exists.  Just pass the

> file name to the function.  If it comes back true, the

> page exists.  Something like this:

>

> <%

>  If FileExists("gothere.asp") then

>    response.redirect

>  else

>    do something

>  end if

> %>

>

> Mark

>

> --- Ken Schaefer <ken@a...> wrote:

> > You will need a component to do a HTTP GET request

> > for the page on the 2nd

> > server. If the HTTP Response is 200 OK, then you

> > execute the redirect.

> >

> > If the HTTP response is 404 (File Not Found), or if

> > there is no HTTP

> > response (the server is not available, or able to

> > respond), then you do

> > Response.Redirect

> >

> > Look into using the Microsoft ServerXMLHTTP

> > component to do this for you.

> >

> > Cheers

> > Ken

> >

> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> > From: "Simon Garstin" <sales@o...>

> > Subject: [asp_web_howto] Response.redirect

> >

> >

> > : the reason for the recent 404 file question:

> > :

> > : suppose a response.redirect command does not work

> > because the web page

> > does

> > : not exist or the destination server is down - is

> > there any way to stay

> > : within the asp page and do something else eg.

> > :

> > : <fictitious code>

> > : if not response.redirect

> > "http://www.somesite.com/somepage.htm" then

> > :     <do something else>

> > : end if

> > : </fictitious code>

> >

> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> >

> >





> $subst('Email.Unsub').

>

>

> __________________________________________________

> Do You Yahoo!?

> Send your FREE holiday greetings online!

> http://greetings.yahoo.com

>




$subst('Email.Unsub').

>

>




  Return to Index