Response.Clear(); Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xls", fileName)); Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.xls"; StringWriter stringWrite = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); grdGridView.RenderControl(htmlWrite); Response.Write(stringWrite.ToString()); Response.Flush(); Response.End();
grdGridView.RenderControl(htmlWrite);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)