2010-06-08 3 views
0

post 메서드와 window.open을 사용하여 asp.net에서 새 팝업 창을 열어야합니다.로드 페이지 (ASP.NET)에서 Method = 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"; 
    } 

URL :

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.

전 서버의 유효성을 테 방법 becose 포스트 방법을 사용해야하고, window.open becose 난 당신이 개체 조작한다고 생각

덕분에 최대

+1

질문은 무엇입니까 :

그래서 필요한 유일한 변화는 다음과 같다? –

답변

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에 팝업의 이름을 설정하고 있기 때문에, 당신은 다음 passwd 폼의 target 특성을 설정할 수 있어야합니다.

<form ... target="passwd"> 
관련 문제