Pinoy2015
Pinoy2015

Reputation: 1459

'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

Upvotes: 3

Views: 2956

Answers (1)

angus
angus

Reputation: 690

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.

Upvotes: 1

Related Questions