Cyrille Rey

Cyrille Rey

  • NA
  • 25
  • 39k

C# form redirection

Apr 2 2012 8:37 AM
Hi there,

I have a webpage that processes payments using PayPal.

Once the customer has chosen the product they want, they fill in their personal details and when they click the buy button, they are supposed to be redirected to the PayPal website to log in and process the payment.

Since my website is iframe based, I need the PayPal login page to open in a new window, as PayPal does not allow their pages to be viewed in iframes.

My problem is that the redirection works fine with IE9, but strangely with none of the other browsers I have tested it with (FireFox, Opera and Safari). These don't open a new window and generate an error saying that the current content cannot be viewed in an iframe.

Below is the code for the redirection:

sb.Append("<html><head><title>Redirecting to Paypal...</title></head><body onload=\"document.forms[0].submit();\",target='_blank'>");

Does anyone know why it does not work with browsers other than IE9?

Thank you.


Answers (2)