How do I redirect using POST

  • Thread starter Thread starter davidfahy
  • Start date Start date
D

davidfahy

Hi all

How can I transfer user to another server using POST. The problem is
that
Server.Transfer (preserves form data) works just in current server.
Response.Redirect - uses GET method. However I have to open a remote
server
page using POST method. Using HttpWebRequest class is not good
solution, as I can post to and read data from remote server, but user
browser itselft is still connected to my
server.

Thanks in Advance
 
you have to do it in client script. render a html form with an auto post.

<form name=mypost action="othersite.com" method=post>
<input type=hidden name=field1 value="value1">
<input type=hidden name=field2 value="value2">
</form>
<script>document.forms["mypost"].submit();</script>


-- bruce (sqlwork.com)
 
Would returning the HTTP response for "Permanently moved" do it?
 
How can I transfer user to another server using POST.

If you're using .NET 2.0, then you can set the URL to post to in the button
properties. If you're using .NET 1.1, then you have to do it through some
client side script.
 
Hi all

How can I transfer user to another server using POST. The problem is
that
Server.Transfer (preserves form data) works just in current server.
Response.Redirect - uses GET method. However I have to open a remote
server
page using POST method. Using HttpWebRequest class is not good
solution, as I can post to and read data from remote server, but user
browser itselft is still connected to my
server.

Thanks in Advance

If you are using 2.0 you can look into PostBackURL for buttons and images
and linkbuttons
 
Back
Top