【问题标题】:ASP.net - Problem with integrating formASP.net - 集成表单的问题
【发布时间】:2011-04-21 07:52:13
【问题描述】:

WorldPay 支付网关建议使用此 HTML 将客户带到支付页面:

<form action="https://select-test.wp3.rbsworldpay.com/wcc/purchase" name="BuyForm" method="POST">
<input type="hidden" name="instId"  value="211616">
<input type="hidden" name="cartId" value="abc123">
<input type="hidden" name="currency" value="GBP">
<input type="hidden" name="amount"  value="0">
<input type="hidden" name="desc" value="">
<input type="hidden" name="testMode" value="100">
<input type="submit" value="To Payment!">
</form>

如何将此表单放在我的页面上?问题是我有一个母版页,它将内容页面内容包装在 ASP.net 表单中,我无法嵌套表单。

【问题讨论】:

    标签: c# asp.net forms nested-forms


    【解决方案1】:

    这有点小题大做,但我过去曾在 paypal 中使用过它。基本上只需在您尝试发布的表单上方放置一个额外的表单,如下所示:

    <form>
    </form>
    <form action="https://select-test.wp3.rbsworldpay.com/wcc/purchase" name="BuyForm" method="POST">
    <input type="hidden" name="instId"  value="211616">
    <input type="hidden" name="cartId" value="abc123">
    <input type="hidden" name="currency" value="GBP">
    <input type="hidden" name="amount"  value="0">
    <input type="hidden" name="desc" value="">
    <input type="hidden" name="testMode" value="100">
    <input type="submit" value="To Payment!">
    </form>
    

    享受吧!

    【讨论】:

      【解决方案2】:

      您可以自定义 HtmlForm 以使其正常工作。我在这里给出了一个代码示例:

      How to get past embedding a html form for paypal buttons asp.net

      http://www.codersbarn.com/post/2008/03/08/Solution-to-ASPNET-Form-PayPal-Problem.aspx

      我已经多次在母版页上使用它了 :-)

      【讨论】:

        猜你喜欢
        • 2021-08-05
        • 1970-01-01
        • 1970-01-01
        • 2016-12-27
        • 2011-08-30
        • 1970-01-01
        • 1970-01-01
        • 2014-06-25
        • 2012-01-23
        相关资源
        最近更新 更多