Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'System.Threading.ThreadAbortException' in ASP.net page

I have the below code in my ASP.net page:

Response.StatusCode = 404
Response.Write(strResult)
Response.End()

The code above throws "An exception of type 'System.Threading.ThreadAbortException' occurred and was caught."

Can anyone tell me the reason why? And do I solve this.

thanks

like image 495
Pinoy2015 Avatar asked Jan 22 '26 13:01

Pinoy2015


1 Answers

Calling Response.End() from any child object of the page will most likely cause the 'System.Threading.ThreadAbortException' exception.

Please read this for a full explaination of why this is happening and methods to avoid/deal with the exception.

like image 118
angus Avatar answered Jan 25 '26 06:01

angus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!