 <p>Do not use response in that case, this will ask the Save as dialog box. If you want to save the file to your disk without any prompt do something like this. I am giving you in C#</p> <pre><code>System.Web.UI.WebControls.DataGrid grid = new System.Web.UI.WebControls.DataGrid(); grid.HeaderStyle.Font.Bold = true; grid.DataSource = datatable; grid.DataMember = datatable.TableName; grid.DataBind(); using(StreamWriter sw = new StreamWriter ("d:\\temp\test.xls")) { using (HtmlTextWriter hw = new HtmlTextWriter(sw)) { grid.RenderControl(hw); } } </code></pre>