ASP.NET 2.0 - How to refresh page after download

J

Jurjen de Groot

I have an 'Export' button on my page, when clicking this button, a file is
streamed to the client like this :

lblMessage.Text = "Thank you for downloading...";
System.IO.FileInfo objFI = new System.IO.FileInfo(FullFileName);
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition",
"attachment; filename=" + DownloadFileName);
System.Web.HttpContext.Current.Response.AddHeader("Content-Length",
objFI.Length.ToString());
System.Web.HttpContext.Current.Response.ContentType =
"application/octet-stream";
System.Web.HttpContext.Current.Response.WriteFile(objFI.FullName);
System.Web.HttpContext.Current.Response.End();

This works perfectly but after downloading, the page on wich the
download/export was initiated doesn't update, the lblMessage isn't updated
as is a button wich should become visible after download. I'm not sure how
to accomplish this.

Could anyone point me in right direction.

TIA,
Jurjen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top