GVAS.Visible = false; Response.Clear(); Response.Buffer = true; // Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.doc"); // Response.ContentType = "application/vnd.ms-word "; Response.ContentType = "application/vnd.xls"; Response.Charset = ""; Response.AddHeader("content-disposition", "attachment;filename=MyList.xls"); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); GVAS.AllowPaging = false; GVAS.DataBind(); GVAS.RenderControl(hw); 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)