After painfuly studying this issue concerning Dotnetnuke and Paypal, I have found a solution that my conscience won't allow me to keep to myself. Of course, this isn't limited to Dotnetnuke, as it is an all around asp.net issue.
To fully utilize Paypal's Buy Now, Add to Cart, Subscribe, View Cart, Gift Certificates, etc... it all comes down to utilizing iFrames. I've noticed that many have come close to fixing this issue, perhaps many have but haven't really posted anything, since I looked for days and couldn't seem to find a solid answer.
1. If you remove the form tag and go that route you're still going to run into multiple issues. The first is you are going to have difficulty having more than one product on a page. If a customer adds 1 to cart, and then on the same page adds another, the two forms will mesh, and... well, just try it out and you'll see the problem.
Using IFrames is wonderful, considering each product is actually it's own little page, just hidden within the main page - So you can have as many products on there as you want.
Lets use Dotnetnuke of course as the example.
Go to your Paypal Merchant Account.
Click on the button you want to create.
Create it.
Click "View Code"
Then make sure there isn't any encryption in the code if it gives you that option (only for some buttons.)
Paste the Code into notepad.
Now add some simple tags to make it an HTML page. *** I had to modify this message due to the HTML in the example.. so I've just added an attachment.
DOWNLOAD THE ATTACHMENT by right clicking over it and "save target as." ... and read along. If you just click on it it's going to try to show as an HTML page, but I removed by paypal button code.. so if you click add to cart it'll give you an error.
Notice the: target="_blank"
This is the only code that I added to the page. This provides a better customer experience because after viewing their newly added item to cart they can click on continue shopping, and the window will close.
Now save your file as an .html file. Create a directory off of your root directory on your web server called "iframes" and keep all the code in there, separated by product category (just a suggestion.)
Then in the Iframe settings, point the link to http://yourwebsitename/iframes/nameoffile.html
Now you're going to run into another issue of dissapearing content in iFrames if you're not careful. Make sure to manually set the size of the iframe and turn off the auto-scroller. If you do this, the data won't dissappear periodically - which is really annoying. Then when you try to show people the problem, it doesn't do it for them... -shakes-
The wonderful thing about this Iframe is you're creating an HTML page, and therefore can do anything you want in it, such as background color changes, images, videos... the possbilities are endless.
This trick works with every single paypal button. The only one I would do something different with is the Gift Certificate, in which a simple link opening in a new window will do just fine. When creating the Gift Certificate, after viewing the code.. Click on Email link instead of HTML.
I have completed my online store with this integration, and it is working perfectly. Check it out at:
http://imperishabledesign.com
patrick.ryan@live.com