Just as the error states, you cannot do a redirect once headers, or any
parge of the page, has been sent to the client. An alternative to what you
are doing would be to just write client side script directly into the
response.
i.e.
Response.Write("<script
language=javascript>window.navigate('mynewpage.asp x);</script>")
Response.End
The above script is not a function so it will execute inline immediately
when sent to the browser and direct client to another page. Think of it as
an immediate client side redirect.
"Glen Wilkin via DotNetMonster.com" <fo***@nospam.DotNetMonster.com> wrote
in message news:e7******************************@DotNetMonste r.com...
Is there a way I can call Response.Redirect after I've done a
Response.Flush?
I send some html to load an animated gif that plays whilst my page loads,
it has some extensive database calls to process. However, when I try to
redirect to my error handling page, if there is an error, I get a 'Cannot
redirect after HTTP headers have been sent' error.
I've got round the problem by using a javascript function in the body
onload event that checks a hidden field whose value is set when an error
ocuurs, but this does seem very elegant.
Any ideas?
--
Message posted via http://www.dotnetmonster.com