BrianHawkinsTech

  • Increase font size
  • Default font size
  • Decrease font size
Home Development Adding a View Cart button when using Paypal with ASP.NET

Adding a View Cart button when using Paypal with ASP.NET

E-mail Print PDF
User Rating: / 9
PoorBest 

If you have used Paypal with a simple website, you may be familiar with Paypal's button creator.  It allows you to create HTML buttons that you can embed on your pages.  However this does not work so well with ASP.NET due to the multiple FORM elements.  I have found other examples of how to create "Add to Cart" buttons with ASP.NET and used those methods with success.  However, I could not find a simple example to create a "View Cart" button that linked to the PayPal shopping cart.  This is a very simple process.  

1) Add an ASP.NET button to your web form.

2) In the Click event for your button, add the following code (this is VB):

  Dim MerchantId as string = "xxxx" 'set this to your Secure Merchant ID or Paypal Email Address 

  Response.Redirect("https://www.paypal.com/cart/display=1&business=" & MerchantId)

 

Add comment


Security code
Refresh

Recommended Web Hosting

hawkinstech150x150ad

Free Stuff!

Visit my Advertisers

Toshiba - Toshibadirect.com






Newsflash

This site has been migrated to the new and improved HawkinsTech Hosting platform.  As part of this migration I have decided to upgrade and redesign the site.  I hope you found the new BrianHawkins Tech site to be more usable and helpful!