ASP.NET 怎样实现网页“自动刷新”,或者子窗口关闭时刷新父窗口??被采纳给80分... 实现刷新:<HEAD> <TITLE>刷新内容</TITLE> <META HTTP-EQUIV="REFRESH" CONTENT="x; URL=*.*"> </HEAD> x 是刷新的时间,单位是秒。*.* 是刷新的文件。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 >>>子窗口关闭时刷新父窗口child.aspx中<script language=javascript>function closeWin(){ parent.location.reload(); window.close();}</script> <META HTTP-EQUIV="REFRESH" CONTENT=10"; url=www.sina.com"> --------http://expert.csdn.net/Expert/topic/2165/2165977.xml?temp=.4100305 本页刷新Response.Write("<script language='javaScript'>window.location.href=window.location.href;</script>");子窗口刷新你窗口Response.Write("<script language='javaScript'>window.parent.location.href=window.parent.location.href;</script>"); 如果子窗口是通过WINDOWS.OPEN打开的,可以这样刷新父窗口:我是在一个子窗口里做完删除后关闭子窗口,刷新(也就是从新加载)父窗口的:Page.RegisterStartupScript("ok","<script>alert('删除成功');</script>");Page.RegisterStartupScript("turn1","<script>window.opener.location='PARENT.aspx';</script>");Page.RegisterStartupScript("turn2","<script>window.opener=null;window.close();</script>"); 1, 页面自身刷新:在<head>标签之间加入:<META HTTP-EQUIV="REFRESH" CONTENT="你要刷新的间隔秒数"> 2, 子窗口关闭时刷新父窗口:在子窗口中<body MS_POSITIONING="GridLayout" language=javascript onunload="return window_onunload()"><script id=clientEventHandlersJS language=javascript><!--function window_onunload() {window.opener.location.reload()}//--></script> window.opener.refresh();window.opener=null;window.close()http://expert.csdn.net/Expert/topic/1571/1571300.xml?temp=.6878168 <body onbeforeunload="opener.location.reload()"> var arWindows=new Array();function UpdateOpener(){ if(window.opener !=null || window.opener !="undefined") { window.opener.location=window.opener.location; window.opener.focus(); }}function OpenChildWindow(url){ newWindow=window.open(url,"_blank"); newWindow.oponer=window; childwindow[arWindows.length]=newWindow; newWindow.focus();}function closeChildWindow(){ var i=0; for(i=0;i<=arWindows.length-1;i++) { if (arWindows[i]!= null) arWindows[i].close(); }}以上js实现如下功能:parent关闭时同时调用function closeChildWindow(),则所有子窗口关闭child关闭时调用UpdateOpener,则更新parent要在ie5.5以上才行 parent.location.reload();or parent.location.href='plmm.aspx'; 刷新用:<META HTTP-EQUIV="REFRESH" CONTENT="x; URL=*.*"> 更新父窗口用:<body onbeforeunload="opener.location.reload()"> 或 <body MS_POSITIONING="GridLayout" language=javascript onunload="return window_onunload()"><script id=clientEventHandlersJS language=javascript><!--function window_onunload() {window.opener.location.reload()}//--></script>已搞定,谢谢个位老大... MVC遇到的问题 求教,关于在Web服务在web Form开发下的一个难题 Repeater 中按钮事件 如何找到修改其中一列的数据 哪位大哥发给我一份关于纯粹B/S方式实现InfoPath的设计和运行时的源码?谢谢 页面样式的问题 关于TreeView控件节点添加刷新问题 同页参数传递问题 正则问题!! 100分求:ASP.NET中怎么放大、缩小、旋转、打印图像? 如何把以下字符串解析为DateTime实例? iis问题:默认WEB着站点(已停止)&地址已使用?在线等! session很快自动过期的问题.
function closeWin()
{
parent.location.reload();
window.close();
}
</script>
--------
http://expert.csdn.net/Expert/topic/2165/2165977.xml?temp=.4100305
Response.Write("<script language='javaScript'>window.location.href=window.location.href;</script>");子窗口刷新你窗口
Response.Write("<script language='javaScript'>window.parent.location.href=window.parent.location.href;</script>");
我是在一个子窗口里做完删除后关闭子窗口,刷新(也就是从新加载)父窗口的:Page.RegisterStartupScript("ok","<script>alert('删除成功');</script>");
Page.RegisterStartupScript("turn1","<script>window.opener.location='PARENT.aspx';</script>");
Page.RegisterStartupScript("turn2","<script>window.opener=null;window.close();</script>");
在<head>标签之间加入:<META HTTP-EQUIV="REFRESH" CONTENT="你要刷新的间隔秒数"> 2, 子窗口关闭时刷新父窗口:
在子窗口中
<body MS_POSITIONING="GridLayout" language=javascript onunload="return window_onunload()"><script id=clientEventHandlersJS language=javascript>
<!--function window_onunload() {
window.opener.location.reload()
}//-->
</script>
http://expert.csdn.net/Expert/topic/1571/1571300.xml?temp=.6878168
function UpdateOpener(){
if(window.opener !=null || window.opener !="undefined")
{
window.opener.location=window.opener.location;
window.opener.focus();
}
}function OpenChildWindow(url){
newWindow=window.open(url,"_blank");
newWindow.oponer=window;
childwindow[arWindows.length]=newWindow;
newWindow.focus();
}function closeChildWindow()
{
var i=0;
for(i=0;i<=arWindows.length-1;i++)
{
if (arWindows[i]!= null) arWindows[i].close();
}
}
以上js实现如下功能:
parent关闭时同时调用function closeChildWindow(),则所有子窗口关闭
child关闭时调用UpdateOpener,则更新parent要在ie5.5以上才行
更新父窗口用:<body onbeforeunload="opener.location.reload()"> 或 <body MS_POSITIONING="GridLayout" language=javascript onunload="return window_onunload()"><script id=clientEventHandlersJS language=javascript>
<!--function window_onunload() {
window.opener.location.reload()
}//-->
</script>已搞定,谢谢个位老大...