E
Earl Teigrob
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
Earl
.....
dl.UpdateDownloadDate(pkDownloadMaster,System.DateTime.Now);
DataBindGrid(dl.SelectOrderNo(pkDownloadMaster));
string filename= "downloadfile.txt";
string filepath = Page.MapPath(".") + "\\" + filename;
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=\"" +
filename + "\"");
Response.WriteFile(filepath);
Response.End();
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
Earl
.....
dl.UpdateDownloadDate(pkDownloadMaster,System.DateTime.Now);
DataBindGrid(dl.SelectOrderNo(pkDownloadMaster));
string filename= "downloadfile.txt";
string filepath = Page.MapPath(".") + "\\" + filename;
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=\"" +
filename + "\"");
Response.WriteFile(filepath);
Response.End();