How to set file download inside the update panel

Topics: Developer Forum, Project Management Forum, User Forum
Jun 28, 2010 at 9:36 PM
Guys, I am using Excel package I want to know how I can set file for download inside the update panel. I tried this code System.Web.HttpContext.Current.Response.Clear(); System.Web.HttpContext.Current.Response.ContentType = "application/"; System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=Audit_Number_Result.xlsx"); System.Web.HttpContext.Current.Response.WriteFile(outputDir.FullName + @"\Audit_Number_Result.xlsx"); System.Web.HttpContext.Current.Response.End(); But still I am getting error any help and idea, is there is any method in Excelpackage that allow file to save at response directly. Thanks
May 12, 2011 at 9:31 PM
Edited May 12, 2011 at 9:32 PM

Please add a PostBackTrigger to your Control which is used to Download.



            <asp:PostBackTrigger ControlID="cmdExport" />