I am using MVC and C#, I need to post a form to an external payment website. But i would like the result page to appear in an Iframe on my view.
<form id='myform' action="https://externalsite.somewhere" method="post" target="myframe">
@Html.HiddenFor(model => model.SomeData)
@Html.HiddenFor(model => model.MoreData)
<input type="submit" value="do it"/>
</form>
<iframe id="myframe" width="600px" height="600px"></iframe>
I could be going about this in the wrong way, i have never done this before so If you have any suggestions or advice on this i would really appreciate it.
Simply create the
<iframe>inside your view and have thesrcof this iframe pointing to a controller action that will serve a view containing this form. When the user submits the form he is redirected to the payment website inside the iframe.