Paypal 表单破坏了我的 ASP.NET webforms 布局 ->如何解决?
我是一名学生,正在用asp.net 制作一个简单的网站。我的问题是,我希望在其中一个页面上集成 Paypal,但是 asp.net 有 荒谬
我可以帮忙吗?
I am a student who is doing up a simple website in asp.net. My problem is, I wish to integrate Paypal on one of the pages, but asp.net has the ridiculous <form runat="server">
that is getting in my way. I am building a simple site layout using blueprint css, a very basic three-column layout. However, I need my main content section to be able to use the paypal form (buy now button), and the other areas of the site to use user controls, which I presume requires them to be wrapped in that irritating form tag. In fact, I would like to have a sitemap path control at the top of the main section of the site: something very basic. How might I achieve that? My problem is: I can't put the Paypal button in the form, and I don't know how to shift a 4th div into place. I am not even sure how divs and forms stack on each other.
Could I have some help please?
The page with the problem is: http://clubofpep.org/sandbox/sandbox_Alumni.aspx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与普遍看法相反,您可以在 ASP.Net Web 表单页面上拥有多个表单。您不能做的是拥有多个带有 runat="server" 的窗体,在 ASP.Net 主窗体内嵌套第二个窗体,或在主窗体外部使用 asp.net 服务器控件。
因此,要将单独的 Paypal 表单与 ASP.NET Web 表单页面的其余部分集成,您必须确保可以将其放在页面上所有 ASP.NET Web 控件之前或之后。页面,然后编辑 aspx 标记以确保您的 paypal 表单完全在 asp.net 表单之外。
另一件事是,快速网络搜索显示大量为 ASP.NET 编写的 Paypal 控件,这些控件将与提交付款所需的 ASP.NET 表单配合使用。你总是可以尝试其中之一。
Contrary to popular belief, you can have more than one form on ASP.Net webforms pages. What you cannot do is have more than one form with runat="server", nest a second form inside ASP.Net's main form, or use asp.net server controls outside the main form.
Therefore, to integrate a separate paypal form with the rest of an asp.net webforms page, you have to make sure that you can put it either before or after all of the asp.net web controls on the page, and then edit the aspx markup to make sure your paypal form is completely outside of asp.net's form.
The other thing is that a quick web search shows a multitude of paypal controls written for asp.net that will work with the required asp.net form to submit the payment. You could always try one of those.
用法:
ASPX:
代码隐藏:
USAGE:
ASPX:
Code-Behind: