I just want to be able to press on a button and get an xmldocument file to download.I've tried allot of things, for example:\[code\]XmlDocument doc As XmlDocument() = //Method that gets a xmldocumentResponse.Clear()this.Response.ContentType = "text/xml"xmldoc.Save(this.Response.OutputStream)\[/code\]and\[code\]Dim xmldocument As XmlDocument = //Method that gets a xmldocumentUsing stream As MemoryStream = New MemoryStream() Dim xmlWriter As XmlTextWriter = New XmlTextWriter(stream, System.Text.Encoding.ASCII) xmldocument.WriteTo(xmlWriter) xmlWriter.Flush() Dim byteArray As Byte() = stream.ToArray() Response.Clear() Response.AppendHeader("Content-Disposition", "filename=MyExportedFile.xml") Response.AppendHeader("Content-Length", byteArray.Length.ToString()) Response.ContentType = "application/octet-stream" Response.BinaryWrite(byteArray) xmlWriter.Close() End Using\[/code\]Nothing works, am i forgetting something obvious? because nothing works, the xmldocument is loaded everything seems fine but the file never downloads and the "response" does absolutely nothing!An answer in Csharp or VB.NET would be helpfull