string fileName = "attachment;filename= DetailReport.xlsx";
Response.Clear();
Response.AddHeader("content-disposition", fileName);
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
grdExcel.RenderControl(htmlWrite);
Response.Output.Write(stringWrite.ToString());
Response.Flush();
Response.End();
Try it with above code.
Hope that helps.