日期:2014-05-20  浏览次数:20932 次

急急急 window.showModalDialog
A页面点击事件里面window.showModalDialog,弹出B页面时,怎么传值到A页面?怎么把B页面的listbox里面的值传到A页面的ListView里面。很希望有人给出例子


------解决方案--------------------
1.利用 showModalDialog的returnValue来传值

2.session
------解决方案--------------------
JS下如:
A页面:
 var ReturnText = window.showModalDialog(winUrl, window, "dialogHeight:600px;dialogWidth:750px;help:no;resizable:no;status:no;");
B页面:
window.returnValue = "返回值";
------解决方案--------------------
方法1:关闭showModalDialog的传值方法
var ret = window.showModalDialog("B.aspx")
alert(ret)
在B.aspx;里面写

window.returnValue="new的值"
window.close()

方法2:不关闭showModalDialog的传值方法
 window.showModalDialog("B.aspx",window)

B.aspx里面写
window.dialogArguments.document.getElementById("对象id").innerHTML = "xxx"


------解决方案--------------------
var f = function(){
var obj = document.getElementById("content");
var str =window.showModalDialog("a.htm",obj,"dialogWidth=300px;dialogHeight=200px");

}
var obj = window.dialogArguments;
alert(obj.value)

listBox1.SelectedItem.ToString()取值
http://topic.csdn.net/u/20091020/16/b3e78af2-add8-422f-a2ae-67dd58c33a84.html