Using Paypal Buy Now buttons with BlogEngine.Net

Whle I was building toomanygoobyes.com. I knew that there had to be provision for selling the CD via Paypal. However, through a combination of goodness knows what, this seemingly simple process became very tricky indeed.

First off, on the order page, I simply pasted the code for the button into the HTML and saved it. Lo and behold, the TinyMCE editor that is used as the text editor for BlogEngine.Net rather frustratingly strips out all <form> tags.

So, I then spend several hours looking for ways round this. There had to be a simple solution. The nature of the website was such that a full e-commerce solution or even DNN site would be overkill. Anyway, there were some suggestions of how to stop the code stripping out but nothing worked, so I hit upon the nextt thing . . . .

I created a user control called myPaypalButton.ascx and injected this into the order page in three places. I then saved the page and the buttons displayed. So far so good.

Click the first button and there is a post back to the existing page. Click the other two, however, and Paypal is thrown up and all is well. Still, it's no good having a non functioning button.

As it turned out the solution to all of this was not complex, unlike some of the answers I found on the internet. Indeed, the answer could not be found on the internet.

The solution?

I simply created a dummy form in my user control before the real form:

<form action=""></form>

I then uploaded the control ad all three buttons worked Hurrah!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add comment


 

biuquote
Loading