views:

668

answers:

2

Hi all,

i do Postback in my Page1.aspx to another page. If a press F5 key in Page1.aspx its appears the message (To display the webpage again, Internet Explorer needs to resend the information you've previously submitted. If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.)

I have this javascript code, which is the solution for my issue ??

thanks in advance

function calc() 
{
    var pagoConPopup = true;

    if (pagoConPopup) 
    {
        var ventanaTPV = window.open('', 'ventanaTPV', 'width=725,height=600,scrollbars=no,resizable=yes,status=yes,menubar=yes,location=yes');

        if (ventanaTPV == null || !ventanaTPV || typeof (ventanaTPV) == "undefined") 
        {
            alert("Se ha detectado bloqueador de ventanas emergentes. Desactívelo para proceder al Pago");
        }
        else 
        {
            document.forms[0].target = 'ventanaTPV';
            hacerSubmitPOST();
            ventanaTPV.focus();
        }
    }
    else 
    {
        hacerSubmitPOST();        
    }
}


function hacerSubmitPOST() 
{
    //*** Prueba de Hack ***
    //alert('Prueba de hack Amount');
    //document.getElementById("Amount").value = "12000";
    //*** Fin Prueba de Hack ***
    document.forms[0].action = '<%=strURLTpvVirtual%>';
    document.forms[0].submit();    
}
+1  A: 

If after the redirect, the URL still says Page1.aspx, then in fact the redirect did not happen, since the URL would change to whatever the other page's URL is. Post your server-side code so we can look at where the Redirect should be happening.

RedFilter
+1  A: 

The button1_click register Script for calc function javascript. This calc function does submit to another page.

protected void Button1_Click(object sender, EventArgs e) {

strDs_Merchant_MerchantURL = Request.Params["Ds_Merchant_MerchantURL"]; ...

Page.ClientScript.RegisterStartupScript(this.GetType(), "jsPagoPorTPV", "calc();");

}

In the aspx:

< input type="hidden" name="Ds_Merchant_MerchantURL" value="< % =strDs_Merchant_MerchantURL% >" >

Thanks mister.

Alhambra Eidos