Response.Write and Response.Redirect

  • Thread starter Thread starter slawekg
  • Start date Start date
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
 
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.
 
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?
 
Back
Top