Hi,
Base on your description, when you close the popup window, make the parent window postback and pass the element value into parent window's textbox, right?
You can try to use the showModalDialog, like below:
1. The parent page:
<script language="javascript">
<!--
/**//**
* @param newUrl ModalDialog page path
* @param wLen ModalDialog's width
* @param iLen ModalDialog's height
**/
function OpenModalDialog(newURL,wLen,hLen)
{
try
{
//Open the link
var recdata=showModalDialog(newURL,"DescWindow","dialogWidth:"+wLen+"px;dialogHeight:"+hLen+"px;center:1;scroll:1;help:0;status:0");
if(recdata != null)
{
window.document.all.txt.value = recdata;
}
}
catch(err)
{}
}
-->
</script>
<a href="javascript: OpenModalDialog('Default4.aspx', 700, 500)">Open the Modal Dialog</a>
<asp:TextBox ID="txt" runat="server"></asp:TextBox>
2. The child page:
<head runat="server">
<title>Untitled Page</title>
<script language=javascript type="text/javascript">
function closemd()
{
var str = window.document.all.TextBox1.value;
window.returnValue = str;
window.close();
}
</script>
<base target="_self">
</head>
<body>
<form id="Form1" method="post" runat="server">
<asp:Button id="btnOk" runat="server" Text="OK" OnClientClick="closemd()"></asp:Button>
<INPUT type="button" value="Cancel" onclick="javascript: window.close();">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</form>
Hope it helps.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Yours sincerely,
Amanda Wang
Microsoft Online Community Support