ASP.NET MVC-2 Post to another website?
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">
<%= 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");
}
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.
精彩评论