Response.redirect and throw in catch block

What will happen in the following scenario? Will he quit work after response.redirect?

Or I need to use Response.Redirect in the catch block of the main method, where it throws a stack of exception calls ....

try
{    
//code
}
catch(Exception ex)
{    
Response.Redirect("Error.aspx");
throw;    
}
+3
source share
2 answers

, , , , End(). , (endResponse) true. End() , , throw.

: http://msdn.microsoft.com/en-us/library/a8wa7sdt.aspx

, endResponse true . End , ThreadAbortException .

, , endResponse false.

+7

Response.Redirect( ), , .

, false, . Response.Redirect("Error.aspx", false), .

( , ).

+3

Source: https://habr.com/ru/post/1720510/


All Articles