
C# 关闭弹出页面问题
用C#做的WEB项目,当点击一个链接,弹出一个新页面,关闭这个新页面时,原来那个页面会刷新,请问怎么解决胜这个问题?...
用C#做的WEB项目,当点击一个链接,弹出一个新页面,关闭这个新页面时,原来那个页面会刷新,请问怎么解决胜这个问题?
展开
2个回答
2013-08-19
展开全部
你是要原页面刷新还是不刷新啊。。。说清楚点
已赞过
已踩过<
评论
收起
你对这个回答的评价是?

2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
2013-08-19
展开全部
<script language=javascript>
function outPut()
{
var text = document.abc.text.value;
var win = window.open("","mywin", "menubar=no,width=400,height=100,resizeable=yes");
win.document.writeln("<title>输出结果</title>");
win.document.writeln("你的信息是:<p>");
win.document.writeln(text);
win.document.writeln("<input type=text name=child value=子窗口信息>");
//对子窗口本身操作,使用self对象,对父窗口操作使用opener对象,这是关键
//把子窗口中表单的值回传给父窗口,取代父窗口表单以前的值,然后关闭子窗口
win.document.writeln("<input type=button value=关闭自己 onClick='window.opener.abc.text.value=self.child.value;self.close()'>");
//可以控制关闭父窗口
win.document.writeln("<input type=button value=关闭父窗口 onClick='window.opener.opener=null;window.opener.close()'>");
//刷新父窗口
win.document.writeln("<input type=button value=刷新父窗口 onClick='window.opener.location.reload()'>");
win.document.close();
win.focus();
}
</script>
<form name=abc method=post>
<input type=text name=text size=50>
<input type=button value=提交 onClick="outPut()">
</form>
function outPut()
{
var text = document.abc.text.value;
var win = window.open("","mywin", "menubar=no,width=400,height=100,resizeable=yes");
win.document.writeln("<title>输出结果</title>");
win.document.writeln("你的信息是:<p>");
win.document.writeln(text);
win.document.writeln("<input type=text name=child value=子窗口信息>");
//对子窗口本身操作,使用self对象,对父窗口操作使用opener对象,这是关键
//把子窗口中表单的值回传给父窗口,取代父窗口表单以前的值,然后关闭子窗口
win.document.writeln("<input type=button value=关闭自己 onClick='window.opener.abc.text.value=self.child.value;self.close()'>");
//可以控制关闭父窗口
win.document.writeln("<input type=button value=关闭父窗口 onClick='window.opener.opener=null;window.opener.close()'>");
//刷新父窗口
win.document.writeln("<input type=button value=刷新父窗口 onClick='window.opener.location.reload()'>");
win.document.close();
win.focus();
}
</script>
<form name=abc method=post>
<input type=text name=text size=50>
<input type=button value=提交 onClick="outPut()">
</form>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询