2009-07-16 13 views
0

私は別のページに自分のPage1.aspxでポストバックを行います。購入した場合は、[キャンセル]をクリックして、重複したトランザクションを回避する必要があります(このページを表示するには、Internet Explorerで以前に送信した情報を再送信する必要があります)。それ以外の場合は、[再試行]をクリックしてWebページを再度表示してください)。ポストリダイレクト - ASP.NETで取得

私はこの問題を解決するJavaScriptコードを持っていますか? URLは、他のページのURLは何に変わってしまうので、事前に

おかげで

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();  
} 
+0

+1に対抗する-1 –

答えて

1

リダイレクトした後、URLはまだPage1.aspxを言うならば、実際にはリダイレクトが、実現しませんでした。サーバー側のコードを投稿して、リダイレクトをどこで実行するかを確認してください。

1

button1_click登録calc関数用スクリプトjavascript。このcalc関数は、別のページに送信します。 ASPXで

protected void Button1_Click(object sender, EventArgs e) 
{ 
    strDs_Merchant_MerchantURL = Request.Params["Ds_Merchant_MerchantURL"]; 
    ... 

    Page.ClientScript.RegisterStartupScript(this.GetType(), "jsPagoPorTPV", 
     "<script language='JavaScript'>calc();</script>"); 

} 

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

ありがとうミスター。

関連する問題