Response.Clear(); Response.Buffer = false; Response.AddHeader("content-disposition", "attachment;filename=Export.txt"); Response.Charset = ""; Response.ContentType = "application/vnd.ms-notepad"; using (StringWriter sw = new StringWriter()) { HtmlTextWriter hw = new HtmlTextWriter(sw); sw.Write(ViewState["resultForDownload"].ToString()); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)