c# - response.redirect and throw in catch block -


What will happen in the following scenario? What will throw this job after the reaction? Forward?

Or I need to use the feedback. Redirects to the main block of catch blocks where this exception throws the call stack ....

  try {// code} hold (exception before) {Response.Redirect ("Error.aspx") ; throw; }  

Since you are not supplying parameters to indicate that current By implementing the page or not, it will automatically end the page by calling End (). Using the method with one parameter is similar to calling the method with two parameters, the second (endresports) is set to true . Since an end () result is an exception being thrown, it will never reach your throw statement.

Reference:

When you use this method in a page handler, complete a request for a page and start a new request for the second page, Set end to Reply or call redirection method overload. This method ends the call for the original request, which throws the ThreadAboutException exception upon completion.

If you want to continue to execute the page, then you need to use the signature with two parameters and set the endorsement parameter false for.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -