Redirect and POST

D

Darren Oakey

G'day - I have a problem that I just can't figure out how to solve, and
would desperately love some help!!!

We have an existing product (which we don't have control over) which is a
web server that will produce a PDF document as a report - but from an XML
file that is "POST"ed to the document server.

I have a listbox that lists various reports that are available, and when you
select a report, I want that particular PDF to appear. So, basically, on
selectedindex changed, I want to response.redirect to a URL, but POST some
calculated data to that url, based on the list item selected.

how do I do this? PLEASE help, I'm going insane - I can't find anyway of
doing it! It would work great if I didn't have to send the xml data from
the "client" web page... but I do!

thanx,
Darren
 
R

Rick Strahl [MVP]

Darren,

Response.Redirect() can never post to a different URL because a Redirect()
looses all data that was submitted. THere are some hacks that can make this
work but they're ugly - they basically deal with changing the submit URL
client side and then sending the data.

However, I think the better approach is to pass this data in some other way
than a POST. A QueryString for example, which if you're using Redirect() is
really the only way to get (limited) amounts of data passed


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/blog/
 
V

vMike

If the xml files reside on your server, you should be able to use
response.redirect (or server.transfer) to a page on your site that has all
the form data. Then put a java script on the page to post the form onload.
You will need to be clever about the onload because you don't want the form
to keep posting if someone uses the back button. Your other option is to
use HttpWebRequest/Response. File posting is a bit tricky using this method
but it can be done and that way you don't leave your site. Hope this helps.
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top