本文介绍了是嵌套的<form>可能的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net 网页的内容页面中,我想包含paypal"按钮立即付款".

in a content page of an asp.net web page, i would like to include the "paypal" button "Pay Now".

所以,我有一个母版页和一个内容页.在我的内容页面中,我复制粘贴了贝宝代码.特别是我使用modalpopupextender"来允许我的用户购买该对象.问题是......它不起作用.所以我的假设是:

So, i've a master page, and a content page.In my content page i copy-paste paypal code.In particular i use a "modalpopupextender" to permit my user to buy the object.The problem is... it not work.So my hypotheses are:

  1. 我不确定,但我想我不能使用嵌套的
  2. 如果不是第一个,也许我不能在模态弹出窗口中使用 ?

有人可以建议我一个优雅"的解决方案来解决这个问题吗?谢谢...

someone can suggest me an "elegant" solutions to solve this ?Thank you ...

特别是,我想要做的是允许从网站上销售.我有一个母版页和一个内容页.显然,在母版页中,我有经典的表单操作".然后我去了贝宝并得到了这个代码:

in particular, what i'm trying to do is to permit to sell from a website.I've a master page, and a content page.Obviously in master page i've the classical "form action" .Then i'm gone to paypal and got this code: "

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<table>
<tr><td>
    <input type="hidden" name="on0" value="Annuncio Premium">Annuncio Premium
</td></tr>
<tr><td>
    <select name="os0">
        <option value="Premium 1">Premium 1 €1,00</option>
    </select>
</td></tr>
</table>
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="encrypted" value="-----BEGIN ">
<input type="image" src="https://www.paypal.com/it_IT/IT/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - Il sistema di pagamento online più facile e sicuro!">
<img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>

所以我将它粘贴到我的内容页面中......就像它......没有改变.特别是我已经将它粘贴到一个面板中,该面板将显示modalpopupextender".有用.但它不起作用的是当我点击贝宝立即购买"按钮时.我的网页没有重定向到 paypal,modalpopup 消失了,什么也没有发生.

So i've pasted it into my content page ... as it... without changing.In particular i've pasted it, into a panel, that will show whith a "modalpopupextender".It works. But what it not work is when i click the paypal "Buy Now" button.My web page don't redirect to paypal, modalpopup disappears and nothing happens.

推荐答案

我也遇到了这个问题,无法相信 PayPal 没有为 .NET 开发人员提供某种解决方案!!

I had this exact issue too and couldn't believe that PayPal had not provided some sort of solution for .NET developers!!

我是这样解决的:

<asp:ImageButton ID="btnPayNow" runat="server" ImageUrl="myPayPalButton.jpg"
 PostBackUrl="https://www.paypal.com/cgi-bin/webscr" OnClick="btnPayNow_Click"/>

使用 ImageButton 或普通按钮,只需删除 PayPal 代码的表单标签,保留隐藏的输入字段,数据将发布到 PayPal 网址!

Use an ImageButton or normal button and simply remove the form tags for the PayPal code, leave in the hidden input fields and the data will be posted to the PayPal url!

又好又容易:)

附言.'btnPayNow_Click()' 方法什么都不做,签名存在但我的代码中没有逻辑.

Ps. The method 'btnPayNow_Click()' does nothing, signature exists but there is no logic in the code I have.

这篇关于是嵌套的&lt;form&gt;可能的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 21:48