string filename = "DownloadMobileNoExcel.xls"; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); GridExcelDetails.DataSource = GetTSubscriberDetails; GridExcelDetails.DataBind(); updatexcel.Update(); //Get the HTML for the control. GridExcelDetails.RenderControl(hw); //Write the HTML back to the browser. //Response.ContentType = application/vnd.ms-excel; Response.ContentType = "application/vnd.ms-excel"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + ""); this.EnableViewState = false; Response.Write(tw.ToString()); Response.End();
public override void VerifyRenderingInServerForm(Control control) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)