页面自动刷新代码

1、cs文件中:

     1)Response.Write("<script>window.location.href=window.location.href;</script>");//刷新本页面。

  2)Response.Write("<script>opener.location.href=opener.location.href;</script>");刷新父页。

  3)Response.Write("<script>window.location.href='yourpage.aspx';</script>");转到指定页。

  4)

2、js实现:

  1)<script> window.location.reload(true); </script> 如果是你要刷新某一个iframe就把window给换成frame的名字或ID号

  2)<script> window.navigate("本页面url"); </script>

  3)  function abc()
  {  
    window.location.href="/blog/window.location.href";
    setTimeout("abc()",10000);
  }

  4)定时刷新:

      4.1、<script>setTimeout("location.href='url'",2000)</script>      说明:url是要刷新的页面URL地址 2000是等待时间=2秒

      4.2、刷新框架页   〈script language=javascript>top.leftFrm.location.reload();parent.frmTop.location.reload(); 弹出窗体后再刷新的问题

     Response.Write("<script>window.showModalDialog('../OA/SPCL.aspx',window,'dialogHeight: 300px; dialogWidth: 427px; dialogTop: 200px; dialogLeft: 133px')</script>");//open             Response.Write("<script>document.location=document.location;</script>");

原文地址:https://www.cnblogs.com/ljan/p/2855203.html