2010-06-08 124 views
0

加載頁面(ASP.NET)window.open我需要在asp.net中使用post方法和window.open來重新打開新的窗口。使用方法= POST

我的代碼:

打開彈出:

function mdpbch(URL) { 
    child = window.open(URL, "passwd","dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=475"); 
    child.location.href = URL; 
    if (child.opener == null) { 
     child.opener = window; 
    } 
    child.opener.name = "opener"; 
    } 

網址:

function PagoEnLinea(Banco) 
{ 
    switch(x){ 
     case "BCH": 
      document.frmEnvia.action = SERV + "/llamacom.asp"; 
      url = SERV + "lamacom.asp 
      alert(url); 
      mdpbch(url); 
      document.frmEnvia.submit(); 
      break; 
    }  
} 

ASPX:在頁面加載

<body> 
    <form id="frmEnvia" runat="server" name="formulario" method="post" target="_blank"> 

    <div style="visibility:hidden;"> 
     <asp:TextBox ID="txtXml" runat="server" Visible="true" /> 
    </div> 
    .....  
</body> 

(代碼後面)我創建一個xml字符串並將其放入文本框tx中TXML。

我需要使用POST方法becose服務器驗證TE法,和window.open becose需要自定義彈出

感謝

+1

什麼是你的問題? – 2010-06-08 15:20:35

回答

0

我想你應該操作對象:

parentWindow 

文件內對象;您之前提交表單,像這樣:

switch(x){ 
    case "BCH": 
     document.frmEnvia.action = SERV + "/llamacom.asp"; 
     url = SERV + "lamacom.asp 
     alert(url); 
     mdpbch(url); 
     //here you manipulate the parentWindow element 
     document.parentWindow.scrollbars... (add the attributes you need) 
     //-- 
     document.frmEnvia.submit(); 
     break; 
} 
0

因爲你是彈出窗口的名字爲passwd,則應能形式的target屬性設置爲passwd

因此唯一需要的變化如下:

<form ... target="passwd">