This miffing error is actually by design. The Response.Redirect(string) is the same as Response.Redirect(string, true) which internally calls the Response.End() which will then throws the ThreadAbortException exception to unwind the stack and terminate the current page execution. One way is to use Response.Redirect(string, false) to prevent Redirect from calling Response.End and throwing the exception. You can also explicitly handle the exception, e.g.
Try
Response.Redirect(targetUR
Catch ex As Exception
' do something...
Catch ex As ThreadAbortException
' do nothing to suppress this exception
Finally
' clean up
End Try
TheMehrdad's suggestion is also one possible way to solve the problem.
Some good reading.
http://support.microsoft.c
Henry
Main Topics
Browse All Topics





by: TheMehrdadPosted on 2006-03-17 at 21:30:11ID: 16222717
Hi, you have a code pattern like this:
e.aspx")
Try
' --> Some SqlCommand Commands
Response.Redirect("SomePag
Catch Ex as Exception
End Try
When you redirect the response, an exception of type ThreadAbortException throws. If have handled this command, you will see the results. To solve this problem, always, put Response.Redirect commands outside of your exception handling structure.
Good luck.