ASP.Net的WebForms +贝宝表 [英] ASP.Net WebForms + Paypal Form
本文介绍了ASP.Net的WebForms +贝宝表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前想的PayPal整合到我们现有的Web应用程序。
I am currently trying to integrate PayPal into our existing Web Application.
Web应用程序使用ASP.NET WebForms的。
The Web Application is using ASP.NET WebForms.
由于我们的WebForms周围有一个表单元素(几乎)的一切,我不知道如何整合它采用了形式本身就是一个PayPal按钮。
Since in WebForms we have a form element around (almost) everything, I wonder how to integrate a PayPal Button which uses a form itself.
有没有办法做到这一点?
Is there any way to do it?
推荐答案
是的。我做了三个步骤:
Yes. I do it in a three step process:
- 从贝宝code取出表单标签,因为你不能嵌套形式。
- 一个ID,类,或者说加入PayPal按钮,让你发现它在一个jQuery函数(本例使用
paypalbutton
的ID)。 - 添加jQuery脚本赶上点击覆盖窗体发布:
这可能需要修改与您的特定code的工作(但它可能工作原样):
This may need to be modified to work with your specific code (but it may work as is):
$(document).ready(function() {
$("#paypalbutton").on("click",function(n) {
n.preventDefault();
$("#aspnetForm").attr("action","https://www.paypal.com/cgi-bin/webscr");
$("#aspnetForm").submit(); //or whatever your WebForms form element is called
});
});
这篇关于ASP.Net的WebForms +贝宝表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文