Have you followed all the instructions on Paypal when trying to setup a Paypal button in ASP.NET but get nothing but a page refresh (without a redirect) when you click the button? The answer is very simple. HTML forms cannot be nested. You need to add some javascript that will modify the form's "action" property. This will allow the page to the submitted to Paypal.
Here's the sample of the HTML generated on the Paypal site for the encrypted HTML code button:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHVwYJKoZIhCCB0QCAQExggEwMIIBLAIBADCBlDCCSqGSIb3DQE=-----END PKCS7-----">
</form> Here's a modified version of the above HTML code that solves the nested HTML form problem:
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" onclick="document.getElementById('aspnetForm').action='https://www.paypal.com/cgi-bin/webscr';" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHVwYJKoZIhCCB0QCAQExggEwMIIBLAIBADCBlDCCSqGSIb3DQE=-----END PKCS7-----"/>
By eliminating the "form" tag and adding an onClick attribute to the input tag for the Paypal button image, we can use javascript to modify the action property of the HTML form.
document.getElementById('aspnetForm').action='https://www.paypal.com/cgi-bin/webscr';
Make sure that the form id matches what you have. I hope this helps.