Forum Moderators: open

Message Too Old, No Replies

Response.Redirect and the ThreadAbortException

         

Gibble

5:39 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, so we have a user control which is a wizard, it includes other user controls based on the step, there's a point in it, at which I need to do a httpcontext.current.response.redirect(url) to a different page. Unfortunately, I get the lovely, ThreadAbortException and it doesn't end up redirecting. According to MSDN (kb #312629), the solution is to use redirect(url, false) so it doesn't trigger response.end ... though, while I don't notice a new error...it doesn't redirect at all, I end up remaining on the same page.

Help. Has anyone experienced this and found a solution?

Gibble

7:11 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Got it, I just do the following after the redirect.

Context.Response.Flush()
Context.Response.End()