{"id":428,"date":"2020-02-13T04:44:58","date_gmt":"2020-02-13T04:44:58","guid":{"rendered":"http:\/\/hawktech.us\/site\/?p=428"},"modified":"2020-02-13T04:44:59","modified_gmt":"2020-02-13T04:44:59","slug":"adding-a-view-cart-button-when-using-paypal-with-asp-net","status":"publish","type":"post","link":"https:\/\/hawktech.us\/site\/adding-a-view-cart-button-when-using-paypal-with-asp-net\/","title":{"rendered":"Adding a View Cart button when using Paypal with ASP.NET"},"content":{"rendered":"\n<p>If you have used Paypal with a simple website, you may be familiar with Paypal&#8217;s button creator. &nbsp;It allows you to create HTML buttons that you can embed on your pages. &nbsp;However this does not work so well with ASP.NET due to the multiple FORM elements. &nbsp;I have found other examples of how to create &#8220;Add to Cart&#8221; buttons with ASP.NET and used those methods with success. &nbsp;However, I could not find a simple example to create a &#8220;View Cart&#8221; button that linked to the PayPal shopping cart. &nbsp;This is a very simple process. &nbsp;<\/p>\n\n\n\n<p>1) Add an ASP.NET button to your web form.<\/p>\n\n\n\n<p>2) In the Click event for your button, add the following code (this is VB):<\/p>\n\n\n\n<p>&nbsp;&nbsp;Dim MerchantId as string = &#8220;xxxx&#8221; <em>&#8216;set this to your Secure Merchant ID or Paypal Email Address&nbsp;<\/em><\/p>\n\n\n\n<p>&nbsp;&nbsp;Response.Redirect(&#8220;https:\/\/www.paypal.com\/cart\/display=1&amp;business=&#8221; &amp; MerchantId)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have used Paypal with a simple website, you may be familiar with Paypal&#8217;s button creator. &nbsp;It allows you to create HTML buttons that you can embed on your pages. &nbsp;However this does not work so well with ASP.NET due to the multiple FORM elements. &nbsp;I have found other examples of how to create&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[95],"tags":[],"class_list":["post-428","post","type-post","status-publish","format-standard","hentry","category-web-development"],"_links":{"self":[{"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/comments?post=428"}],"version-history":[{"count":0,"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/posts\/428\/revisions"}],"wp:attachment":[{"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/media?parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/categories?post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hawktech.us\/site\/wp-json\/wp\/v2\/tags?post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}