response.Clear(); response.Buffer = true; response.AddHeader("content-disposition", "attachment;filename=ShowData.xls"); response.ContentType = "application/ms-excel"; //response.ContentEncoding = System.Text.Encoding.Default; response.Charset = ""; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); grd.AllowPaging = false; if (data != null) { grd.DataSource = data; grd.DataBind(); } foreach (int Index in GridIndexLst) { grd.Columns[Index].Visible = false; } grd.RenderControl(hw); //string style = @"<style> .textmode { mso-number-format:\@; } </style>"; //response.Write(style); response.Output.Write(sw.ToString()); response.Flush(); response.End();
response.ContentType = "text/html"; response.Charset = "utf-8";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)