Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I redirect using POST

Reply
Thread Tools

How do I redirect using POST

 
 
davidfahy@gmail.com
Guest
Posts: n/a
 
      06-14-2006
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

 
Reply With Quote
 
 
 
 
bruce barker \(sqlwork.com\)
Guest
Posts: n/a
 
      06-14-2006
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)

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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
>



 
Reply With Quote
 
 
 
 
Peter Morris [Droopy eyes software]
Guest
Posts: n/a
 
      06-14-2006
Would returning the HTTP response for "Permanently moved" do it?


 
Reply With Quote
 
Erik Funkenbusch
Guest
Posts: n/a
 
      06-14-2006
On 14 Jun 2006 07:47:22 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> 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.
 
Reply With Quote
 
vMike
Guest
Posts: n/a
 
      06-14-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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


 
Reply With Quote
 
nzmike nzmike is offline
Junior Member
Join Date: Jul 2009
Posts: 1
 
      07-01-2009
Hi,

Did you have any luck with this? I need to do the same thing but I also need to pass variables to the URL being called (which is an external ecommerce payment gateway). I also can't use an HttpWebRequest object for doing this as the page needs to display, not just load and return the results.

If I use something like this in my form:

<form id="form1" method="post" runat="server">

<asp:HiddenField id="EPS_MERCHANT" value="ACB1234" runat="server" />
<asp:HiddenField id="EPS_PASSWORD" value="FUH5F8JHD9" runat="server" />

<asp:Button ID="btnSubmit" PostBackURL="https://<website>/post/authorise" text="Submit Payment" runat="server" />
<form>

it will redirect to the site but not pass any of the parameters.

I'm using .Net 2.0 - surely thre is way to do this without using WebRequest?

Could the fact none of the parameters in my page posts have anything to do with the target site being a secure one?

Cheers,

Mike
 

Last edited by nzmike; 07-01-2009 at 08:58 AM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Reponse.Redirect Using the POST Method Samuel Shulman ASP .Net 1 11-28-2006 01:04 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM
using redirect with post method opo ASP General 2 01-15-2004 03:04 PM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM



Advertisments