有没有办法返回打开子窗口的用户控件对象父项?

时间:2012-12-12 18:14:29

标签: window.open

我在页面上使用了多个控件,其中包含控件内部的3个按钮。其中一个按钮启动另一个对话框窗口,完成后关闭并返回一个值。正确返回该值,问题是子节点的父节点始终是添加到页面的最后一个控件。有没有办法指定哪个控件是子窗口的真正父级?

function Button1Click(){
    window.open('<%=DialogLocationHref %>');
}
function Button1Returned(retValue){
    document.getElementById('<%=txtValue1.ClientID%>').value = retValue;
}

父窗口摘录

...
if (window.parent.Button1Returned != null){
    window.parent.Button1Returned('+ someValue + ');
}

0 个答案:

没有答案