核心代码: parent.ymPrompt.doHandler('close');
代码示例:
父页面代码:
function SelectNode() {
ymPrompt.win({ message: '../BCSelect/SelectNodes.aspx', handler: callBack, width: 850, height: 450, showMask: false, title: '选择网点', iframe: true, dragOut: false, btn: [['', 'close']] })
}
function callBack(tp) {
//alert(tp);
if (tp != "close") {
str = tp.split("&");
for (i = 0; i < str.length; i++) {
document.getElementById("hdNodeIDs").value = str[0];
document.getElementById("txtNodeNames").value = str[1];
} //end for (i = 0; i < str.length; i++)
} //end if (tp != "close")
}
<asp:TextBox ID="txtNodeNames" runat="server" CssClass="input_Style" οnblur="this.className='input_Style'"
οnfοcus="this.className='input_Focus'" Width="80%" ></asp:TextBox>
<asp:HiddenField ID="hdNodeIDs" runat="server" />
<input οnclick="SelectNode()" class="submit1" type="button" value="选择网点" />
子页面:
function SetNode()
{
var val = "00001&海口网点" ;
window.parent.ymPrompt.doHandler(val, true);
}
<input οnclick="SetNode();" type="button" class="submit1" value="选择" />
<input οnclick="parent.ymPrompt.doHandler('close');"type="button" class="submit1" value="关闭" />