private void Button2_Click(object sender, System.EventArgs e)
{
RegisterStartupScript( "key ", " <script> window.returnValue=document.all( 'upFile ').value;window.opener=null;window.close(this); </script> ");
}
父窗口如何获得返回的值呢?
------解决方案--------------------------------------------------------
父窗口:
function OpenWindow(Url){
}
------解决方案--------------------------------------------------------
var r = window.showModelDialog(...);
alert(r);
------解决方案--------------------------------------------------------
请参考
1
<script type= "text/javascript ">
function btnOpen_Click()
{
//document.MainForm.txtValue.value = window.open( "2 ", null, "height=300,width=300,status=no,toolbar=no,menubar=no,location=no ");
document.MainForm.txtValue.value = window.showModalDialog( "2 ");
}
</script>
<form name = "MainForm ">
<input type = "button " value= "Click " name = "btnOpen " onClick= "btnOpen_Click(); " />
<input type = "text " name = "txtValue " />
</form>
2
<script type= "text/javascript ">
function btnOpen_Click()
{
window.returnValue = document.Form1.txtValue.value;
alert (document.Form1.txtValue.value);
window.close();
}
</script>
<form name = "Form1 ">
<input type = "button " value= "Click " name = "btnOpen " onClick= "btnOpen_Click(); " />
<input type = "text " name = "txtValue " />
</form>