3

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

4

1 回答 1

1

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.

于 2012-05-30T01:28:22.713 回答