嵌套<形式为GT;可能? [英] Is nested <form> possible?

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

问题描述

在一个asp.net网页的内容页,我想包括贝宝按钮立即付款。

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

所以,我母版页和内容页。
在我的内容页我复制粘贴的PayPal code。
特别是我用一个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. 如果不是第一个,也许我不能使用<形式的作用> 成一个模式弹出?

  1. I'm not sure, but i think i can't use a nested <form action>
  2. If not the first, maybe i can't use a <form action> into a modal popup ?

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

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

编辑:特别是,我想要做的是允许从一个网站出售。
我有一个母版页和内容页。
很显然,在母版页,我的经典的形式行动。
然后我去了PayPal和得到这个code:

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.

推荐答案

我有这个确切的问题过分,简直不敢相信,贝宝还没有.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正常按钮,只需删除了贝宝code中的表单标签,留在隐藏的输入字段和数据将被张贴到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()'什么也不做,签名存在,但没有在code我没有逻辑。

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

这篇关于嵌套&LT;形式为GT;可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆