Redirect and POST

  • Thread starter Thread starter Darren Oakey
  • Start date Start date
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
 
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/
 
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.
 
Back
Top