English 中文(简体)
在dotnetnukeHtml模块中实现贝宝添加到购物车按钮代码
原标题:Implement paypal add to cart button code in dotnetnuke Html module
  • 时间:2011-02-08 05:46:21
  •  标签:
  • dotnetnuke

Hi I Have a dotnetnuke site.In my web site i want to place two paypal add to cart button in an HTML module. it s working for only one button. i have removed the form tag and form submitted on Button click. but i need to place two button . does any one know this?

谢谢

最佳回答

听起来你已经解决了这个问题,但为了正确的上下文:以下是Mitchel Sellers关于主题的博客文章

To include an HTML form within DNN you will first need to note the "Action" property that is set in the tag. Once you know this action you will want to remove the opening and closing form tags. Now, in the HTML source location the submit button ( or similar) . Then add the following inside the tag declara tion.

onClick="this.form.action= YourUrlHere ;this.form.submit();" Be sure to put your Action URL inplace of the "YourUrlHere" text. This tells the HTML form that if the submit button is clicked that it should change the form action, which will prevent ASP.NET postback and then it actually submits the form to the new URL.

This provides you a quick and reliable method to submit HTML forms to external sites. This isn t the best solution as other input items on the current page will be submitted to the action page, however, typically that is not too large of an issue.

下面是我使用jQuery提出的一个更为复杂的方法/示例,它应该专门解决您的问题:

<p class="item">
  Buy <span class="name">A Product</span> for $<span class="price">9.99</span>
  <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_SM.gif" style="border:solid 0px black;" name="submit" alt="click here to order">
</p>

$( p.item input[type=image] ).click(function(){
  var $itemDetail = $this.parent( p.item );
  var name = $itemDetail.find( .name ).val();
  var price = $itemDetail.find( .price ).val();
  window.open( https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=youremail%40address.com&item_name=  + name  +  &amount=  + price +  &no_note=1&currency_code=USD&add=1 ,  yourcartwindowname );
});

这种方法的重要特征是为您提供一个html“模板”,该模板可以重复使用,并可用于每个项目。它还会在一个新窗口中打开PayPal购物车页面,如果用户在购物车中添加了多个项目,它会保持同一窗口。非常简单但相对快速且易于实现,如果您可以依赖JavaScript实现此功能的话。

问题回答

暂无回答




相关问题
How do you alter the page_load for DotNetNuke

For the main menu, I want the first four links to be blue, and specifically the last four links to be yellow. There will only be eight menu items. I was thinking of hard coding the yellow links into ...

ASP.NET MVC project to port [closed]

Is there a project out there that attempts to replicate or re-create a portal framework like DotNetNuke using MVC framework

how to install dnn (v 5.2.0) in vs (any of 2005 or 2008)?

i need to install DNN on my pc. I dont mind what dotnet version this would be: either 2005 or 2008 but i need to install DNN v 5.x.y and not any previous installation + also need to configure in my ...

dotnetnuke doubts

i want to build a website in dnn 5. i have studied dnn5, its installation, starter-kit installation, built-in modules (both of Host and Admin), installing a custom module (from module extension), ...

Develop a Family Tree Portal with several functinality

We need to develop a family tree portal which also supports functinality like Portal Framework (Sub portal) Dashboard Blogs, Forums, Events, Polls, Task Member subscription Advertisement Chat ...

Domain Name Windows Vista Does Not Exist In The Database

I am trying to install DOTNETNUKE model on my local machine ( Windows Vista) but seem to be running into a problem right after installing the Database. Not exactly sure where to go to fix the problem ...

Find all CSS styles used on website

I have a DotNetNuke skin that has a single CSS file over 3,500 lines long. It contains styles for YUI, Telerik, Cluetip as well as the actual customisation of the site. The old developers just kept ...

热门标签