I've had a few reports of a shopping basket system I implemented a few years ago in C# ASP .NET not working with IE10. This is .NET 2.0, and compiled now with VS2010 Pro but originally 2005. Predictably it works fine when I debug it on my laptop in both debug and release, but doesn't work on the old IIS6 server.
This is what should happen:
1. The user goes to a pay page called DoDirectPayment.aspx with fields for name, address, credit card numbers etc. Then they press a submit button. The submit button has a client side script which disables itself and changes its text to "Please wait".
2. The submit button should call PayButton_Click function on the server, which sets session variables and does Response.Redirect("DoHostedPayment2.aspx");
3. DoHostedPayment2.aspx displays "contacting payment provider" and has an invisible form which is filled out by the server and posted immediately to PayPal with some client side JS.
4. PayPal displays its customised page with our logo etc.
With IE10, the redirect to DoHostedPayment2.aspx doesn't appear to work. The submit button correctly disables itself, and changes its text, and then the same page reloads (with the submit button enabled again). So I'm guessing it isn't managing to call the onClick handler on the server.
Code:
I'm getting a warning that GetPostBackEventReference is obsolete, but surely as all this predates IE10 by a number of years that can't be the reason?
This is what it generates on the client onClick handler:
I don't really understand by what voodoo the above makes the server call its PayButton_Click handler, but it does in the other browsers, and does in the debugger.
Does anyone know what's going on here?
This is what should happen:
1. The user goes to a pay page called DoDirectPayment.aspx with fields for name, address, credit card numbers etc. Then they press a submit button. The submit button has a client side script which disables itself and changes its text to "Please wait".
2. The submit button should call PayButton_Click function on the server, which sets session variables and does Response.Redirect("DoHostedPayment2.aspx");
3. DoHostedPayment2.aspx displays "contacting payment provider" and has an invisible form which is filled out by the server and posted immediately to PayPal with some client side JS.
4. PayPal displays its customised page with our logo etc.
With IE10, the redirect to DoHostedPayment2.aspx doesn't appear to work. The submit button correctly disables itself, and changes its text, and then the same page reloads (with the submit button enabled again). So I'm guessing it isn't managing to call the onClick handler on the server.
Code:
Code:
private void Page_Load(object sender, System.EventArgs e){ System.Text.StringBuilder sbValid = new System.Text.StringBuilder(); sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { "); sbValid.Append("if (Page_ClientValidate() == false) { return false; }} "); sbValid.Append("this.value = 'Please wait...';"); sbValid.Append("this.disabled = true;"); sbValid.Append("document.all.PayButton.disabled = true;"); // this much must be working //GetPostBackEventReference obtains a reference to a client-side script function that causes the server to post back to the page. sbValid.Append(this.Page.GetPostBackEventReference(this.PayButton)); sbValid.Append(";"); this.PayButton.Attributes.Add("onclick", sbValid.ToString());
This is what it generates on the client onClick handler:
Code:
__doPostBack('PayButton',''); WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("PayButton", "", true, "", "", false, false))
Does anyone know what's going on here?
Comment