Why Response.Redirect causes System.Threading.ThreadAbortException?

前端 未结 10 1828
误落风尘
误落风尘 2020-11-22 15:00

When I use Response.Redirect(...) to redirect my form to a new page I get the error:

A first chance exception of type \'System.Threading.ThreadAbortEx

10条回答
  •  温柔的废话
    2020-11-22 15:25

    What I do is catch this exception, together with another possible exceptions. Hope this help someone.

     catch (ThreadAbortException ex1)
     {
        writeToLog(ex1.Message);
     }
     catch(Exception ex)
     {
         writeToLog(ex.Message);
     }
    

提交回复
热议问题