469,913 Members | 2,683 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

Redirect and POST

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
Nov 18 '05 #1
2 2599
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/
----------------------------------
Making waves on the Web
"Darren Oakey" <da*****@smb.com.au> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2
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.
"Darren Oakey" <da*****@smb.com.au> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Bob Garbados | last post: by
8 posts views Thread by Victor | last post: by
6 posts views Thread by DotNetGruven | last post: by
3 posts views Thread by Jed | last post: by
2 posts views Thread by ETK | last post: by
1 post views Thread by David | last post: by
10 posts views Thread by Savanah | last post: by
56 posts views Thread by UKuser | last post: by
1 post views Thread by gnawz | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.