File Download Problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to download a file created on the fly from a string using Response.Write(), but cannot get around the problem of having to use Response.End() to prevent the HTML for the page being added to the end of the file

Once the Download dialog has been invoked, I want to immediately Redirect to another page within the same browser window. Obviously, calling Response.End() precludes this

There must be a simple way of doing this. Any suggestions garatefully received

Thanks

Martin
 
Hi, Martin Lee,

You can't send redirect instruction after you have sent any content to the
client. In other words the response should be

- 200 OK followed by the actual content
or
- 302 Found and redirect to the other address

Can't be both.

Hope this helps
Martin
Martin Lee said:
I am trying to download a file created on the fly from a string using
Response.Write(), but cannot get around the problem of having to use
Response.End() to prevent the HTML for the page being added to the end of
the file.
Once the Download dialog has been invoked, I want to immediately Redirect
to another page within the same browser window. Obviously, calling
Response.End() precludes this.
 
Back
Top