views:

155

answers:

3

i need open pop up in asp.net using post Method and window.open to rezise te new windows.

my code:

Open the pop up:

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>

on page load (code behind) i create a xml string and put it in the textbox txtXml.

i need use post method becose the server validate te method, and window.open becose need customize the pop up

thanks

A: 

post metohd on form tag not works... can i do this on javascript function?

Raul
A: 

I think you should manipulate the object:

parentWindow

Inside the document object; before you submit the form, something like this:

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;
}
lidermin
A: 

Since you are setting the name of the popup to passwd, you should then be able to set the target attribute of the form to passwd.

So the only change needed is the following:

<form ... target="passwd">
jessegavin