Im using the following code to save an xml file
HttpResponse response = HttpContext.Current.Response;
string xmlString = "<xml>blah</xml>";
string fileName = "ExportedForm.xml";
response.StatusCode = 200;
response.AddHeader("content-disposition", "attachment; filename=" + fileName);
response.AddHeader("Content-Transfer-Encoding", "binary");
response.AddHeader("Content-Length", _Buffer.Length.ToString());
response.ContentType = "application-download";
response.Write(xmlString);
This works fine when binding to a button onlick event for example. But im generating my xml in a generic handler.ashx. So i want to wait until the ajax call is complete before i do the stuff above. Can i do it all in the handler? The ajax call is made by jquery and the xml data is based on input fields on my page. Thanks
I would use something like this.
Then mod the web.config of your project.