protected void ExportBtn_Click(object sender, ImageClickEventArgs e) { gv.Columns[7].Visible = false; gv.Columns[8].Visible = false; Response.ClearContent(); Response.AppendHeader("content-disposition", "attachment; filename=Documents.xls"); Response.ContentType = "application/excel"; gv.AllowPaging = false; gv.DataBind(); StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); Response.Charset = String.Empty; gv.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)