G
Guest
Hi all
In a web user control I have a linkbutton, when the user clicks on it I
retrieve some object from a web service, this object’s class was created
using xsd.exe. I serialize the object using an XmlSerializer and the
resulting string is effectively the XML I want. It is stored in “restultâ€, I
wrote the following code to send the xml to the client as a download file
dialog:
Page.Response.Clear();
Page.Response.ContentType = "text/xml";
Page.Response.AppendHeader("Content-Disposition",
"attachment;filename=Test.xml");
Page.Response.ContentEncoding = System.Text.Encoding.UTF8;
Page.Response.Output.Write(restult);
Page.Response.Flush();
The client successfully sees the file download dialog box, but the result is
not only the XML, it also has all HTML of the page and the user control
appended to the value of result!
How can I avoid that?
Any link to read about?
In a web user control I have a linkbutton, when the user clicks on it I
retrieve some object from a web service, this object’s class was created
using xsd.exe. I serialize the object using an XmlSerializer and the
resulting string is effectively the XML I want. It is stored in “restultâ€, I
wrote the following code to send the xml to the client as a download file
dialog:
Page.Response.Clear();
Page.Response.ContentType = "text/xml";
Page.Response.AppendHeader("Content-Disposition",
"attachment;filename=Test.xml");
Page.Response.ContentEncoding = System.Text.Encoding.UTF8;
Page.Response.Output.Write(restult);
Page.Response.Flush();
The client successfully sees the file download dialog box, but the result is
not only the XML, it also has all HTML of the page and the user control
appended to the value of result!
How can I avoid that?
Any link to read about?