File Download Problems

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
 
M

Martin Dechev

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.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top