I am having an issue when I post the form from my shopping cart - it works great in Internet Explorer but does not work in Firefox. Has anyone else had this issue and found a solution?
Thanks Angie
Here is the submit button sub:
Protected Sub button_CheckOut_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles button_CheckOut.Click
… load shopping cart, validate etc
Dim s As String = myremotepost.returnForm(newDataTable.Rows(0).Item("AuthorizeNet_ServerURL").ToString)
Response.Write(s)
Me.myPostScript(Page)
End sub
This is the code that submits the form:
Protected Sub myPostScript(ByVal Page As System.Web.UI.Page)
Dim strScript As New System.Text.StringBuilder
strScript.Append("<script language='javascript'>")
strScript.Append("var ctlForm = document.getElementById('frmPP');")
strScript.Append("ctlForm.submit();")
strScript.Append("</script>")
'Registerclientscriptblock does not work in firefox
ClientScript.RegisterClientScriptBlock(GetType(Page), "PPSubmit", strScript.ToString, True)
'RegisterStartupScript does not work in ie or firefox
'ClientScript.RegisterStartupScript(Me.GetType(), "PPSubmit", strScript.ToString)
End Sub
08-10-2011 06:34 AM
A couple changes I made and the clientscript.registerclientscriptblock is working in both Internet Expolorer and Firefox. Internet Explorer flickers my page before transferring to Authorize.Net while Firefox loads my full page before transferring.
ClientScript.RegisterClientScriptBlock(
GetType(Page), "PPSubmit", strScript.ToString, False)
I think the culprit is gettype(page) - I only want it to post the new form not the full page but haven't found a way round that yet. I've tried both gettype(page) and me.gettype() same result for both.
So the changes that I made -
My masterpage was inside my styles folder (don't know why I set it up that way) so I moved it to the root.
Removed the scriptManager for now - I'm not using it.
Changed Boolean value indicating whether to add script tags to False
Still more digging around to do but one step forward :smileyhappy:
Thanks Angie
08-11-2011 09:12 AM - edited 08-11-2011 09:22 AM