Why Response.Redirect causes System.Threading.ThreadAbortException?

前端 未结 10 1824
误落风尘
误落风尘 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:18

    This is just how Response.Redirect(url, true) works. It throws the ThreadAbortException to abort the thread. Just ignore that exception. (I presume it is some global error handler/logger where you see it?)

    An interesting related discussion Is Response.End() Considered Harmful?.

提交回复
热议问题