G
Guest
I'm hoping someone can help with this problem; I've seen only a handful of
postings related to it, but with no clear resolution.
I have an ASP.NET 1.1 page that downloads requested files via the
"Response.BinaryWrite(...)" method. The problem is that the page is
dynamically built, and after the download completes all javascript functions
suddenly break or exhibit unpredictable behavior.
I've traced the issue down the use of the "attachment" attribute when
setting the Content-Disposition header. For example:
Reponse.AppendHeader("content-disposition", "attachment;
filename=testfile.txt");
.... will download the file intact, but the page will lose all of its
javascript references.
I'm also adding the obligatory "Response.End()" statement after the last
"Response.Flush()".
One odd note is that omitting the "attachment" attribute altogether will
allow for some files to download and NOT break the page afterwards. However,
this is not reliable for types that could be rendered to the browser (.txt,
etc.).
Has anyone else come across this problem, and is there any consensus on what
might be causing it? Any feedback, resources, etc., here would be greatly
appreciated.
GRE
postings related to it, but with no clear resolution.
I have an ASP.NET 1.1 page that downloads requested files via the
"Response.BinaryWrite(...)" method. The problem is that the page is
dynamically built, and after the download completes all javascript functions
suddenly break or exhibit unpredictable behavior.
I've traced the issue down the use of the "attachment" attribute when
setting the Content-Disposition header. For example:
Reponse.AppendHeader("content-disposition", "attachment;
filename=testfile.txt");
.... will download the file intact, but the page will lose all of its
javascript references.
I'm also adding the obligatory "Response.End()" statement after the last
"Response.Flush()".
One odd note is that omitting the "attachment" attribute altogether will
allow for some files to download and NOT break the page afterwards. However,
this is not reliable for types that could be rendered to the browser (.txt,
etc.).
Has anyone else come across this problem, and is there any consensus on what
might be causing it? Any feedback, resources, etc., here would be greatly
appreciated.
GRE