Response.Write and Response.Redirect

S

slawekg

Hi!
I'm doing these steps:
-user do some fields filling and click a button
-procedure is fired, it returns some data, I change it to csv file
-I use Response.Write to send file to the user

What I would like to achieve is that AFTER user would get file, he would be
redirected to another page.
I tried it by all known to me ways and I searched the web and found it's not
possible to Response.Redirect after Response.Write [ all under one button ].
Does anybody has any solution to such situation?
with regards,
sg
 
G

Guest

Hi!
I'm doing these steps:
-user do some fields filling and click a button
-procedure is fired, it returns some data, I change it to csv file
-I use Response.Write to send file to the user

What I would like to achieve is that AFTER user would get file, he would be
redirected to another page.
I tried it by all known to me ways and I searched the web and found it's not
possible to Response.Redirect after Response.Write [ all under one button ].
Does anybody has any solution to such situation?
with regards,
sg

Open the file in a new window.
 
G

Guest

Yes, but other than that?

First of all, I don't think that this idea is good for the user. What
should happen if user opened the file, or stopped download it?

Regarding redirect. It sends to a browser HTTP 302 response code. When
you do it after Response.Write the server has already sent a "200"
header, and you will get an error about not being able to modify the
headers. One thing I forgot to mention, there is a Server.Transer
method, did you tried it?
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top