try { string attachment = "attachment; filename=Export.xls"; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/ms-excel"; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); HtmlForm frm = new HtmlForm(); GRD_Final_Report.Parent.Controls.Add(frm); frm.Attributes["runat"] = "server"; frm.Controls.Add(GRD_Final_Report); frm.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); } Catch(Exception ex) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)