现在的位置: 首页 > 综合 > 正文

页面跳转的实现方法收集

2012年05月28日 ⁄ 综合 ⁄ 共 549字 ⁄ 字号 评论关闭
我的方法:
Response.Write("<META HTTP-EQUIV='Refresh' CONTENT='5;URL=default.aspx'>");

两种较常用的方法:
1.在 <head> </head> 标签里头添加:
(5:表示5秒钟刷新;url:表示要跳转到的页面名称(例如newPage.html))

<META   HTTP-EQUIV='Refresh'   CONTENT='5;URL=newPage.html'>

2.用JS:
在 <head> </head> 标签里头添加如下JS:

<script> 
window.onload
=function() 

setInterval(
"redirect();",3000); 
}
 
function redirect() 

window.location.href
="new.aspx"
}
 
</script> 

又有

<script   language='javascript'>window.location.replace(URL);</script>

3.
setTimeout(redirect(),3000);
private   void   redirect()
{
        Page.Response.Redirect("yourURL");
}

抱歉!评论已关闭.