这个主要用javascript实现,
在页面1里打开页面2的代码:
function openSelectDepartmentDialog() {
var result = window.showModalDialog("SelectDepartment.aspx", "", 'edge: Raised; center: Yes; help: No; resizable: No; status: No; dialogHeight: 500px; dialogWidth: 300px; scroll: No');
if (result != null) {
document.getElementById("HiddenField_SuoShuBM").value = result;
}
}
在页面2关闭窗口的代码:
function onSelect(strName) {
window.returnValue = strName;
window.close();
}
如果要传递多个参数,可以用特殊符号隔开,然后在页面1里解析,
我用下面的方法实现(完全可以用):
页面1中方法(添加button的click事件):
function GetBABLocationNo(txtBABLocationNo)
{
var s="top=0,left="+(screen.width - 560) / 2+",height=320,width=580,status=no,toolbar=no,menubar=no,scrollbars=yes"
window.open("页面2.aspx?object=" + txtBABLocationNo,"页面2",s);
}
页面2中方法:
function Selected_Value(sItemNo,txtLocation)
{
window.opener.document.all[txtLocation].value=sItemNo;
window.close();
}