views:

73

answers:

2

What is the best way to POST to another website (so that the users browser is redirected as well) in MVC2? I dont want the user to be able to see the form data simply by using "view source", so I'm not keen on

<form action="http://other-site.com/action"&gt;
    <%= Html.TextBox("something-secret") %>
</form>

Is it instead possible (or advisable) to use an controller action? eg

public ActionResult PostTheData() 
{
    return Post("http://other-site.com/action", "something-secret");
}
A: 

http://stackoverflow.com/questions/2234202/redirect-to-another-website-from-controller

user1111111
I believe that return Redirect(url) does a GET, but I need a POST.
JK
A: 

You can use this persons code: http://geekswithblogs.net/rakker/archive/2006/04/21/76044.aspx to post data to the other server. And after that use Redirect(url) to redirect to the page as well.

Matthew Manela