My code is like this
HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = \"application/pdf\"; HttpContext.Current.Resp
HttpResponse.End (as per documentation) raises a ThreadAbortException and as you do no attempt to handle this your method exits.
HttpResponse.End
ThreadAbortException
I'm not sure exactly why you must use End(), but you could put the "cleanup" code in a finally statement.