Automatic HTTP POST methods

  • Thread starter Thread starter Tim Wade
  • Start date Start date
T

Tim Wade

Does anyone have any ideas on how to do an automatic html form post
using hidden fields without introducing client-side script nor using a
server-side WebRequest by passing the information back up to the
browser while the base href is still set to my site. The problem I was
having with the server-side WebRequest is that the relative links of
the site I am posting to break. I could work my way around it probably
by adding a base ref in the returned html or parsing relative links
and replacing with absolute. I have seen a number of sites do a fairly
nice jump to another site while passing information via POST and was
curious if there is a really good solution to it that I am missing.

To put this in context, I am establishing a single-sign-on connection
with another site. The users will login to my site and once logged in
there is a section for them to access a partner site. This partner
site accepts user registration and login automatically by a form POST.
I need a solid solution that a) does not rely on the browsers script
interpreting (vbscript, jscript, javascript, etc) b) is cross-browser
and if possible html 4.01 compliant, and c) resolves the problem of
relative links (including links to CSSs with relative links) if doing
server-side WebRequest and passing the returned content back up to the
browser.

Thanks for any guidance.
 
Hi Tim,

Although you documented it very well, I think that I do not understand your
post.

I will try to say it in my words
A user logs on to your site
You do a requesting and responsing using HttpWebResponse/HttpWebRequest to
another site
You get the information and send your page back to the user, is that
something you mean?

Cor
 
In this case I am not interested in retrieving any information back from
the POST. I am trying to transfer the user from my site to the partner
site much like a redirect would work.

In general, I am trying to pass information from my site to a partner
site. If the partner site accepted information as parameters in the URL,
I could simply do a server response.redirect along with the parameters.
However, in cases where the partner site only accepts data via form POST
(like using Request.Form instead of Request.QueryString), I need a
method of passing the information automatically just like I can do with
a response.redirect.

I mentioned two basic methods. One method was to do a client-side script
which basically submits a form with hidden fields automatically. This
would be an intermediate or "jump" page. The other method was to use a
HttpWebResponse/HttpWebRequest to do a server-side POST and to pass the
response back to the browser.

The difference that I can see between the two methods is that the
client-side script would indeed transfer the user from my site to the
partner site, but the HttpWebResponse/HttpWebRequest would still keep
the user (note the address bar) on my site and I would have simply told
my server to go browse this site, return the data in the background and
then respond back to the browser with the content.

The bottom line is, I am looking for a way to have the functionality of
a response.redirect, but instead of putting parameters in the URL, I
would send them in the POST via form hidden fields. This method should
not incorporate any kind of client-side script.

Hope that is more clear.

Thanks



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Hi Timothy,

I do not have a answer really so on my lips.

However I have looked in the newsgroup

microsoft.public.dotnet.framework.aspnet

And saw you had not asked this question there.
I will have to search while maybe there is somebody who gives you the answer
direct.

Try it there, will you not find it there, than reply it is an itresting
challenge to do.

I hope this helps,

Cor
 
Back
Top