可以返回值的弹出窗口:用的是window.showModalDialog()方法. window.showModalDialog(URL,dialogArgments.features) 打开一个新窗口
当弹出窗口关闭的时候就能得到返回值,下面有个简单的例子:
开发环境: Visual Studio.Net 2003(C#) + IE6.0
A.aspx
<SCRIPT LANGUAGE=JAVASCRIPT>
function btnGetReturnValue_onclick()
{
var temp= window.showModalDialog("B.aspx","","center=yes;help=no;status=no");
document.Form1.TextBox1.value = temp;
}
</SCRIPT>
{
var temp= window.showModalDialog("B.aspx","","center=yes;help=no;status=no");
document.Form1.TextBox1.value = temp;
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
.......
<Input Type="Button" id=" btnGetReturnValue" onclick="return btnGetReturnValue_onclick() value="获取">
B.aspx.cs
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)