dt = (DataTable)ViewState["Data"]; if (dt.Rows.Count != 0) { string file = new ExcelHelper().ExportToExcel(dt); string rootPath = HttpContext.Current.Server.MapPath("~\\ExcelFiles\\").ToString(); string localCopy = Guid.NewGuid().ToString() + ".xlsx"; File.Copy(file, rootPath + localCopy); string str = rootPath + localCopy; Response.Write(str); // not writing anything Response.Redirect(str); // not going to path.. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)