gridview的值传递到另一个页面??

来源:百度知道 编辑:UC知道 时间:2024/05/14 05:25:34
页面1里面有个textbox控件,点击后弹出页面2,页面2里有个gridview,比如显示客户名单,从中选择一个后,自动关闭页面2,同时将选择的行的值传送给页面1的textbox
请问这个怎么实现的?????

我主要不太清楚不同页面之间可以互相引用控件吗???

这个主要用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.a