asp 页面和 paypal 按钮

发布于 2024-08-28 14:03:05 字数 152 浏览 1 评论 0原文

我有一个 3.5 版本的 asp.net 页面,上面有一个 pay pal 按钮,但是当我单击该按钮时,它只会刷新页面。我想我需要将贝宝按钮封装在某个东西中,这样它就不会触发刷新,而是转到贝宝。

有人知道解决办法吗?我可以使用 updatePanel 或 iframe 吗?

I have an asp.net page in 3.5 that I have a pay pal button on but when I click on the button it just refreshes the page. I think I need to encapsulate the paypal button in something so it is not trigging the refresh but goes to pay pal.

Anyone know a solution? Can I use an updatePanel or iframe?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

大姐,你呐 2024-09-04 14:03:06

我曾经遇到过同样的问题,我只是为我的按钮使用了以下代码:

<asp:ImageButton ID="btnPayNow" runat="server" ImageUrl="~/images/Purchase/payNowButton.jpg" PostBackUrl="https://www.paypal.com/cgi-bin/webscr"/>

希望有帮助!

I had this same issue once, I just used the following code for my button:

<asp:ImageButton ID="btnPayNow" runat="server" ImageUrl="~/images/Purchase/payNowButton.jpg" PostBackUrl="https://www.paypal.com/cgi-bin/webscr"/>

Hope that helps!

阳光下的泡沫是彩色的 2024-09-04 14:03:06

由 paypal 网站生成的 Paypal 现在付款按钮有自己的表单标签。ASP.Net 页面是在表单中使用整个页面生成的,因此您现在在表单中拥有一个无法工作的表单。如果您选择贝宝托管按钮,您可以在 asp.net 页面中使用这样的代码,该代码将起作用:-

;
以 99 英镑订购商品名称

我知道这是一个老问题,但我希望这对其他人有帮助。

另外,请查看此处对问题和其他可能解决方案的讨论。
http://www.blackbeltcoder .com/Articles/ecommerce/quick-and-dirty-buy-now-buttons-in-asp-net

Paypal pay now buttons as generated by paypal site have their own form tags in. ASP.Net pages are generated with the whole page within a form, so you now have a form within a form which wont work. If you opt for a paypal hosted button you can have code like this within the asp.net page which will work:-

<input type="hidden" name="cmd" value="_s-xclick"/>
To order the item name for £99
<input type="hidden" name="hosted_button_id" value="note to programmer-this value is generated by paypal"/>
<asp:ImageButton ID="Button2" runat="server" PostBackUrl="https://www.paypal.com/cgi-bin/webscr" ImageUrl="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" ImageAlign="AbsBottom" />

I know this is an old question, but I hope this helps someone else.

also, take a look here for a discussion of the issues and other possibe solutions.
http://www.blackbeltcoder.com/Articles/ecommerce/quick-and-dirty-buy-now-buttons-in-asp-net

独夜无伴 2024-09-04 14:03:06

我建议您为此使用 PayPal 开发者工具包。他们有很多优秀的代码示例 以及如何在您的 ASP.NET 页面中最好地实现 PayPal。

I would recommend you to use the PayPal Developer Toolkit for this. They're having a lot of good code samples and how to implement PayPal the best in your ASP.NET page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文