Error : Thread was being aborted when writing to xml document on asp.net
<p>I have this code to write a XML document:</p>

<pre><code>System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;

MemoryStream stream = new MemoryStream();

XmlTextWriter  myXmlTextWriter = new XmlTextWriter(stream, Encoding.UTF8);

// building xml document
myXmlTextWriter.WriteEndDocument();

myXmlTextWriter.Flush();

stream.Seek(0, SeekOrigin.Begin);

myXmlTextWriter.Close();
stream.Close();

response.Write( System.Text.ASCIIEncoding.ASCII.GetString(stream.GetBuffer()));

Context.Response.End();
</code></pre>

<p>Then in the xml file, there is a line: "Error : Thread was being aborte"</p>
