Torna al Thread
[CODE]
FileInfo inf = new FileInfo(HttpContext.Current.Server.MapPath(Url));
/*Pur usando inline il file non è aperto dentro il browser ma esternamente in Excel*/
HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("inline; filename=ExportedExcelFile.csv"));
/*Se uso attachment il file viene aperto come allegato Outlook*/
//HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", Url));
HttpContext.Current.Response.ContentType = "application/ms-excel";
HttpContext.Current.Response.AddHeader("Content-Length", inf.Length.ToString());
HttpContext.Current.Response.TransmitFile(inf.FullName);
[/CODE]