[thelist] ASP response.redirect bug

Don Makoviney don at aspalliance.com
Wed Jun 5 17:19:00 CDT 2002


You said:
"The ASP web-application uses Response.Redirect in many places which works
perfectly on Windows based IE 4+ and Netscape 4+ and on Mac Netscape 4+
but intermittently fails on Mac IE 4+. "

I have run into this problem before too. I have not found any known
workarounds.

What many programmers make a good practice of doing is providing a static
link right after the REDIRECT statement, as well as a RESPONSE.END to stop
the logic of the page from rendering.

Something like the following:

<%
Response.Redirect "yourpage.aspx"
'then, in case that doesn't work
'then provide a static link
<a href='yourpage.aspx'>Click here if this page is not automatically
refreshed.</a>
Response.End
%>

-or-

for reusability purposes you could encapsulate it in a subroutine

<%
Sub REDIRECTOR_CHECKER(url)
	Conn.Close	'because you should close your connections before you leave
anyways, right?!
	Set Conn=Nothing
	Response.Redirect url
	Response.Write("<a href='" & url & "'>Click here if this page does not
automatically redirect you.</a>")
	Response.End
End Sub
%>

I do this, and put it in my include file that includes all reusable
functions like this. That way you just call it like so:

Call REDIRECTOR_CHECKER("mypage.asp")

Hope that helps!


Don Makoviney

MAKOVISION.COM
"Handpicked News For Internet Developers"
http://www.makovision.com/

Get the FREE Newsletter
"Cutting Through The Crap"
http://www.makovision.com/subs/




More information about the thelist mailing list