html5中文学习网

您的位置: 首页 > 网络编程 > ASP.NET » 正文

如何更新父窗体_.NET教程_编程技术

[ ] 已经帮助:人解决问题
Response.Write("<script language='javascript'>window.opener.location=window.opener.location.href;</script>")


好了,给你个例子吧,自己改一下就可以了!!
第一种方案是:
file a.htm

function OpenDialog(url,param)
{
return window.open(url,param, "DialogWidth:450px;DialogHeight:450px;help:no;status:no");
}


file b.htm
<script language="javascript">
function js_do(val)
{
self.opener.document.all.filename.value=val
}
</script>

第二种方案是:
file A.htm
<html>
<script language="javascript">
function OpenDialog(url,param)
{
return window.showModalDialog(url,param, "DialogWidth:450px;DialogHeight:450px;help:no;status:no");
}

function js_getData(url)
{
return OpenDialog("b.htm","");
}

</script>
<body>
<form name="myFrm">
<input type="text" name="filename" onclick="this.value=js_getData()">
</form>
</body>
</html>

file b.htm

<html>
<script language="javascript">
function js_do(val)
{
window.returnValue=val;
window.close();
}
</script>
<body>
<form name="myFrm">
<input type="text" name="filename">
<input type="text" name="btnDo" onclick="js_do(this.form.filename.value)">
</form>
</body>
</html>





Response.Write("<script language='javascript'>window.opener.document.all.txt1.value="+theValue+";</script>");



PxjHTML5中文学习网 - HTML5先行者学习网
PxjHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助