While downloading template i m getting following error message.
I have tried instead of Response.Flush(); with Response.End();. But getting same error.
Error: Excepiton in Download:System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
Any idea to avoid above exception
Code
private void DownloadFile(string filePath, string downloadFileName)
{
Response.ContentType = "application/ms-excel";
Response.AddHeader("content-disposition", "attachment; filename=" + downloadFileName);
Response.TransmitFile(filePath);
// Response.Flush();
Response.End();
}
Thanks in advance..