Response.Redirect after a Response.Flush

D

danielhamd

I have a link on an ASP page that loads the Response stream with
a .vcs file stream and then sends it to the clients machine. This
opens the calendar entry in their Outlook, etc. However, once this is
done, I'd like to have the page redirect to a new page that says "You
have successfully blah blah blah." This doesn't seem to be possible,
since the response stream has already been sent with the .vcs file.
Does anyone have any ideas for a clever way around this? I'd like to
let the user know that everything went smoothly.

Thanks,
Daniel
 
J

John Timney \(MVP\)

You could use frame set, one frame to deliver the vcs and set a completed
session variable and one frame to check if the delivery had completed by
checking the session variable, polling it from the iframe. If your send was
concluded then you could probably just refresh the frameset with javascript
an load your message. There might be another eay, but sometime the old
traditional ways are easiest.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

I have a link on an ASP page that loads the Response stream with
a .vcs file stream and then sends it to the clients machine. This
opens the calendar entry in their Outlook, etc. However, once this is
done, I'd like to have the page redirect to a new page that says "You
have successfully blah blah blah." This doesn't seem to be possible,
since the response stream has already been sent with the .vcs file.
Does anyone have any ideas for a clever way around this? I'd like to
let the user know that everything went smoothly.

Thanks,
Daniel

Why do you want to redirect to a new page, why not just display it on
the current page?

You can't use Response.Redirect after anything has been sent to the
browser, as a redirect replaces the response with a redirection page. If
you want to go from an existing page to another page you have to use
Javascript.
 
D

danielhamd

Server.Transfer also does not work. I would ideally like to modify
the current page, but that doesn't work either. Any changes I make to
the page are ignored when I send the file stream to the user's
browser.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Server.Transfer also does not work. I would ideally like to modify
the current page, but that doesn't work either. Any changes I make to
the page are ignored when I send the file stream to the user's
browser.

I see. Anything that you send to the browser after the .vcs file will be
treated as garbage data at the end of that file. You can't both send a
file and an html page in the same response.

If you want to send a file and also display something in the page, you
have to open a separate window for the file.

Example:

<a href="GetMessage.aspx"
onclick="window.open('GetVcsFile.aspx','_blank');">
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top