0

I was working with a generic handler that sends back an XML file as the response, and using code that I already had that did the same thing, from 2 different sources.

The thing is, both sources end their block of code differently, first I have this block

context.Response.Clear()
context.Response.AppendHeader("Content-Disposition", "Attachment; filename=filename")
context.Response.ContentType = "text/xml"
context.Response.Write(myXML)
context.Response.Flush()
context.Response.End()

And then I have the same thing, except that the last line is context.ApplicationInstance.CompleteRequest() instead of context.Response.End()

So I wanted to know what was the difference between both of those lines and which one should I be using

Thanks.

Shadowxvii
  • 1,080
  • 2
  • 12
  • 31
  • take a look at this one which alrady answered http://stackoverflow.com/questions/14590812/what-is-the-difference-between-use-cases-for-using-response-endfalse-vs-appl – sakir Jun 11 '14 at 14:35
  • plus this one http://weblogs.asp.net/hajan/why-not-to-use-httpresponse-close-and-httpresponse-end – sakir Jun 11 '14 at 14:37

0 Answers0