Code I am using:- Response.Clear(); Response.ContentType = "application/x-msexcel"; Response.AddHeader("Content-Disposition", "attachment; filename=File.xls"); Response.ContentEncoding = Encoding.UTF8; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); div1.RenderControl(htw); Response.Write(sw.ToString()); Response.End();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)