asp 页面和 paypal 按钮
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我曾经遇到过同样的问题,我只是为我的按钮使用了以下代码:
希望有帮助!
I had this same issue once, I just used the following code for my button:
Hope that helps!
由 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
我建议您为此使用 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.