ciao a tutti
ho fatto un esportazione di un Table create dinamicamente in foglio excel
//Creo il File XLS
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=Partecipanti.xls");
Response.Charset = string.Empty;
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.ContentType = "application/vnd.ms-excel";
Response.Buffer = true;
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
tPartecipanti.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
viene creato il foglio excel con tutti i miei dati in modo corretto
c'è solo un problema che in fondo a foglio mi compare questo errore, e mi indica la riga del Response.End().
System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at Edulife.Presentation.Web.Views.CourseUser.WriteExc elFile()
Se tolgo il response end , mi crea excel con tutta la pagina aspx.per cui non va bene.
Non capisco a cosa sia dovuto questo errore.