0

I got a following error when
Response.End();
is execute.
enter image description here

Its look like a threading error but unable to handle it.Any body know about the error and how to fix it?.I am using VS2008.Thanks.

4b0
  • 21,981
  • 30
  • 95
  • 142
  • Please Explain What you trying to do .?? – joshua Feb 03 '12 at 05:31
  • Check http://stackoverflow.com/questions/1014439/asp-net-exception-thread-was-being-aborted-causes-method-to-exit . Your problems might not be the same, but I think the answer will help you as well. Or even better, this: http://stackoverflow.com/questions/12476/why-is-my-asp-net-application-throwing-threadabortexception – rikitikitik Feb 03 '12 at 05:54

2 Answers2

1

Why do you need to explicitly call Response.End()? You can call HttpContext.Current.ApplicationInstance.CompleteRequest to get around this issue, but you may want to consider refactoring your code to not prematurely end the response.

Mufaka
  • 2,333
  • 1
  • 18
  • 25
  • Unrelated, but - IMO, response.end is perfectly useful; what he should stay away from are try-catch blocks, period. With few exceptions, there should be only one in the whole app: global app handler, and only to log it (use built-in mechanism for showing error page). –  Feb 03 '12 at 08:11
0

That seems to be expected behavior. You are telling the server to stop processing the page.

http://msdn.microsoft.com/en-us/library/system.web.httpresponse.end.aspx

Stefan H
  • 6,635
  • 4
  • 24
  • 35