Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to redirect output back to browser after Response.WriteFile download???

Thread Tools

How to redirect output back to browser after Response.WriteFile download???

Earl Teigrob
Posts: n/a
I have a datagrid with a download button that raises the itemcommand event.
In the event handler for this event, I have the code below. The problem is
that the download code requires a Response.End() in order to stop further
output the the response stream(such as the posted back page itself). Is
there a way to divert the output stream back to the browser after the file
has downloaded without using a Response.End() (which ends all page
processing) ???

If I can find that, then the postback can occure and my databindgrid will
work and everything is fixed!

Thanks in Advance


dl.UpdateDownloadDate(pkDownloadMaster,System.Date Time.Now);


string filename= "downloadfile.txt";

string filepath = Page.MapPath(".") + "\\" + filename;


Response.ContentType = "application/octet-stream";

Response.AddHeader("Content-Disposition", "attachment; filename=\"" +
filename + "\"");



Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
After gmail logs out, cannot go back through browser back button Author ASP .Net 6 01-22-2009 03:24 PM
Response.Redirect and the Browser's Back Button Robert Kent via .NET 247 ASP .Net 0 08-04-2004 12:51 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM
Filtered output disappears after browser back/forward Brad ASP .Net 5 01-02-2004 12:57 AM
Browser "Back" fails after javascript redirect? Simon Wigzell Javascript 3 10-02-2003 02:24 AM