IT貓撲網(wǎng):您身邊最放心的安全下載站! 最新更新|軟件分類|軟件專題|手機版|論壇轉(zhuǎn)貼|軟件發(fā)布

您當前所在位置:首頁網(wǎng)絡編程.Net編程 → 自動刷新頁面的實現(xiàn)方法總結

自動刷新頁面的實現(xiàn)方法總結

時間:2015/6/28來源:IT貓撲網(wǎng)作者:網(wǎng)管聯(lián)盟我要評論(0)

1)

<meta http-equiv="refresh"content="10;url=http://europeautoinsurance.com/">

10表示間隔10秒刷新一次

2)

<script language=''javascript''>

window.location.reload(true);

</script>

如果是你要刷新某一個iframe就把window給換成frame的名字或ID號

3)

<script language=''javascript''>

window.navigate("本頁面url");

</script>

4>

function abc()

{

window.location.href="/blog/window.location.href";

setTimeout("abc()",10000);

}

刷新本頁:

Response.Write("<script language=javascript>window.location.href=window.location.href;</script>")

刷新父頁:

Response.Write("<script language=javascript>opener.location.href=opener.location.href;</script>")

轉(zhuǎn)到指定頁:

Response.Write("<script language=javascript>window.location.href='yourpage.aspx';</script>")

刷新頁面實現(xiàn)方式總結(HTML,ASP,JS)

'by aloxy

定時刷新:

1,<script>setTimeout("location.href='url'",2000)</script>

說明:url是要刷新的頁面URL地址

2000是等待時間=2秒,

2,<meta name="Refresh" content="n;url">

說明:

n is the number of seconds to wait before loading the specified URL.

url is an absolute URL to be loaded.

n,是等待的時間,以秒為單位

url是要刷新的頁面URL地址

3,<%response.redirect url%>

說明:一般用一個url參數(shù)或者表單傳值判斷是否發(fā)生某個操作,然后利用response.redirect 刷新。

4,刷新框架頁

〈script language=javascript>top.leftFrm.location.reload();parent.frmTop.location.reload();</script〉

彈出窗體后再刷新的問題

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>");

在子窗體頁面代碼head中加入<base target="_self"/>

刷新的內(nèi)容加在 if (!IsPostBack) 中

在框架頁中右面刷新左面

//刷新框架頁左半部分

Response.Write("<script language=javascript>");

Response.Write("parent.left.location.href='PayDetailManage_Left.aspx'");

Response.Write("</script>");

關鍵詞標簽:自動刷新頁面

相關閱讀 WinRAR 實現(xiàn)自動關機網(wǎng)頁頁面設計中CSS十大注意CSS常用技巧之一 禁止文字自動換行AJAX技術 vs 傳統(tǒng)的ASP無刷新技術如何在ASP.NET下遍歷指定頁面上所有控件解決alexa.exe自動彈出網(wǎng)頁病毒

文章評論
發(fā)表評論

熱門文章 手把手教你用好LINQ to SQL手把手教你用好LINQ to SQL在.NET環(huán)境下為網(wǎng)站增加IP過濾功能在.NET環(huán)境下為網(wǎng)站增加IP過濾功能ASP.NET 如何避免頁面重新整理時重復送出ASP.NET 如何避免頁面重新整理時重復送出用Asp.net擴展ExtJS用Asp.net擴展ExtJS

人氣排行 asp.net表單提交方法GET\POST在ASP.NET中如何判斷用戶IE瀏覽器的版本Asp.net中messagebox的實現(xiàn)方法Asp.net中的web.config配置在ASP.NET MVC中實現(xiàn)大文件異步上傳用Iformattable接口控制.Net中文本格式c#.Net經(jīng)典面試題目用Asp.net擴展ExtJS