将ASP.Net值传递到HTML页面

问题描述:

所以...我决定使用PayPal.令我惊讶的是,显然没有一种流畅的方法可以在ASP.net页上使用PayPal表单按钮. OK ....所以我创建了一个带有按钮的HTML页面,并将其插入网站.当用户单击ASP.Net中的Submit时,它将所有数据输入数据库,然后使用按钮....调出HTML页面,效果很好.但是,我要为客户过帐生成的客户ID号,以便当他返回带有PayPal购买证明的站点时,可以在数据库中识别他.我需要做的是创建一个ID,该ID是由ASP.Net页面上的脚本生成的,将该信息传递到HTML页面的PayPal按钮旁边的标签中,以便客户可以将其记录下来并与他的产品一起使用.从贝宝(PayPal)购买证明(发票).如果我使用的是ASP到ASP,则只需创建一个Session值,到此为止.但是如何从ASP页到HTML页获取值?

So...I have decided to use PayPal. To my surprise, there is apparently no smooth way to use a PayPal form button on an ASP.net page. OK....so I create an HTML page with the button on it and I insert it into the website. When the user hits Submit from ASP.Net, it enters all the data into the database and then brings up the HTML page with the button....and that works fine. However, I want to post the generated Customer ID number for the customer so that when he returns to the site with proof of purchase from PayPal, I can identify him in the database. What I need to do is have the ID, which was generated by a script on the ASP.Net page, pass that information to the HTML page into a label along side the PayPal button so the customer can write it down and use it with his proof of purchase (invoice) from PayPal. If I was using ASP to ASP, I would simply create a Session value and that would be the end of it. But how do I get the value from the ASP page to the HTML page?

好吧...首先回答您的问题,您不能传递值到HTML页面.如果您可以在重定向之前生成页面,或者将页面映射到某些自定义引擎,则可以通过将页面注入呈现的页面来将其拉出.

但是,这里更重要的是,您可以在ASP.NET网站中使用PayPal.我在使用ASP.NET后端的Facebook项目上使用PayPal,因此可以肯定.

如果您使用Bing"paypal asp.net",您会发现很多示例和演练(有些来自CodeProject,例如这个 [ ^ ])如何实现相同的目标.

干杯.
Okay...first to answer your question, you can''t pass values to an HTML page. If you can generate the page prior to redirection, or if you''re mapping the page to some custom engine you''d be able to pull it off by injecting it into the rendered page.

But, the more important matter here is that you CAN use PayPal in ASP.NET web sites. I used PayPal on a Facebook project using an ASP.NET back end, so I am certain of it.

If you Bing "paypal asp.net" you''ll find a bunch of examples and walkthroughs (some from CodeProject, like this one[^]) on how to achieve the same.

Cheers.