求助!关于弹出窗口刷新父窗口的问题! 弹出一个窗口,然后刷新原来页面,同时要关系弹出窗口,有这个的代码吗? 例如:a.aspx为原来页面b.aspx为弹出页面要求从b.aspx中取得数据,传递给a.aspx并刷新a.aspx,关闭b.aspx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 window.opener 或者 window.parent 就可以引用父窗口然后传参,刷新操作和操作本窗口一样。===============================http://qqwwee.com/csdn.rarCSDN小助手 看完本文,应该就可以解决了!......................................................................http://www.microsoft.com/china/msdn/library/webservices/asp.net/WorkwithClientSideScript.mspx a.aspxfunction OpenWindowB(){ var s =window.showModalDialog("B.aspx",window ,""); if(s!=null){ //返回值 document.location.replace(document.location.href);//刷新 }}b.aspx;window.onunload(){ returnValue ="返回值";}欢迎大家加入技术中国 .NET技术区 <script>window.parent.location.href;window.close();</script> 我以前做弹出日历选择组件时碰到这个问题,用ShowModelDialog解决的,楼主可以看看http://www.cnblogs.com/Zeus/archive/2005/04/15/138553.htmlP.S.:不是广告:) a.aspx不用刷新在b.aspx里直接传值应该行吧如:Response.Write("<script>window.opener.document.myform.txt_test.value ='"+values+"';window.close();"); a.aspx:<script language="javascript">function aWin(){var obj = new Object(); // obj为aspx传入b.aspx的数据obj.pro = "自定义一个属性";var w = window.showModalDialog("b.aspx",obj,"dialogTop=200px;dialogLeft=250px;DialogHeight=300px;DialogWidth=450px;resizable=no;help=no;status=no;");//w就是从b.aspx取得的数据alert(w);window.location.href = window.location.href;}</script>b.aspx:<script language="javascript">function bWin(){var obj2 = window.dialogArguments; //obj2就是a.aspx传入的参数alert(obj2.pro);//相关操作window.returnValue = "这是一个从b.aspx返回的值";window.opener = null;window.close();}</script> a 页面var s =window.showModalDialog("b.aspx",window ,""); if(s!=null){ //返回值 document.location.replace(document.location.href);//刷新 }b页面if(!IsClientScriptBlockRegistered ("ClientScript")) { string strScript="<script language='javascript'>"; strScript+="window.parent.returnValue='"+strDetailSearch+"';"; strScript+="window.parent.close();"; strScript+="</script>"; Page.RegisterClientScriptBlock("ClientScript",strScript); }window.location.reload(); window.close();window.opener.location.href=window.opener.location.href; http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4 弹出模式窗口无法下载文件问题 gridview循环找值相加 gridview编辑问题!在线等 我想问一下dl.Text.ToString()和request.from["dl"].Tostring()区别 如何获取客户端的硬盘序列号~~急 sql小问题 使用ASP.NET AJAX 能否以HTTP Get的方式用Javascript调用Web服务 怎么将去掉日期类型的小时分? 一个关于DataGrid数据刷新的很奇怪的问题(多了之后就少不了了) CheckBoxList 分组 ? 怎样可以触发textbox change 事件 登录控制问题
然后传参,刷新操作和操作本窗口一样。===============================
http://qqwwee.com/csdn.rar
CSDN小助手
......................................................................
http://www.microsoft.com/china/msdn/library/webservices/asp.net/WorkwithClientSideScript.mspx
var s =window.showModalDialog("B.aspx",window ,"");
if(s!=null){ //返回值
document.location.replace(document.location.href);//刷新
}
}b.aspx;
window.onunload(){
returnValue ="返回值";
}欢迎大家加入技术中国 .NET技术区
P.S.:不是广告:)
在b.aspx里直接传值应该行吧
如:
Response.Write("<script>window.opener.document.myform.txt_test.value ='"+values+"';window.close();");
function aWin()
{
var obj = new Object(); // obj为aspx传入b.aspx的数据
obj.pro = "自定义一个属性";
var w = window.showModalDialog("b.aspx",obj,"dialogTop=200px;dialogLeft=250px;DialogHeight=300px;DialogWidth=450px;resizable=no;help=no;status=no;");
//w就是从b.aspx取得的数据
alert(w);
window.location.href = window.location.href;
}
</script>
b.aspx:<script language="javascript">
function bWin()
{
var obj2 = window.dialogArguments; //obj2就是a.aspx传入的参数
alert(obj2.pro);
//相关操作
window.returnValue = "这是一个从b.aspx返回的值";
window.opener = null;
window.close();
}
</script>
var s =window.showModalDialog("b.aspx",window ,"");
if(s!=null){ //返回值
document.location.replace(document.location.href);//刷新
}b页面
if(!IsClientScriptBlockRegistered ("ClientScript"))
{
string strScript="<script language='javascript'>";
strScript+="window.parent.returnValue='"+strDetailSearch+"';";
strScript+="window.parent.close();";
strScript+="</script>";
Page.RegisterClientScriptBlock("ClientScript",strScript);
}
window.location.reload();