I am looking for a way to open a pop up in asp.net using the post method and window.open to resize the new windows.
Here is my code:
To open the pop up:
function openPopup(URL) {
child = window.open(URL, "popup","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 PaymentOnline(Bank)
{
switch(x){
case "BCH":
document.frmEnvia.action = SERVICE_URL + "/callcom.asp";
url = SERVICE_URL + "callcom.asp
alert(url);
openPopup(url);
document.frmEnvia.submit();
break;
}
}
ASPX:
<body>
<form id="frmSend" runat="server" name="form" 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 an XML string and put it in the txtXml textbox.
I need to use the post method because the server validates the method, and window.open because I need to customize the pop-up window.
Thank you!