Author: tompy_nation | Posted on: 11/30/2009 3:51:13 AM | Views : 293

Hi, i have a button which allows a user to download a file. WHen he presses the following code gets executed. And the Opn/Save/Cancel dialog is shown to him
HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Charset = ""; HttpContext.Current.Response.ContentType = "application/msword"; string strFileName = "GenerateDocument" + ".xml"; HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + strFileName); //string htmlContent = DocGenerator.GetXMLDocument(this.id_ontlening); HttpContext.Current.Response.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); HttpContext.Current.Response.Write("<?mso-application progid=\"Word.Document\"?>"); XMLOntlening xmlOntlening = DocGenerator.GetXmlOntlening(this.id_ontlening); XmlSerialize ...

Go to the complete details ...