</div> </form> </body> </html>default.aspx.cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Write("<script>var dt=setInterval('redirect()',5000);document.write('页面将在5秒后跳转!');function redirect(){location.href='http://news.sina.com.cn/z/08earthquake/index.shtml';}</script>"); } }
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<script language="javascript">
var count=3;
function direction()
{ //计时
if(count==0)
{
location.href = "http://www.sina.com/";
}
document.getElementById("alt").innerHTML="跳转还有"+count+"秒";
count-=1;
setTimeout("direction()",1000);
}
window.onload=direction;
</script>
<div id="alt"></div>
</body>
</html>
在a.aspx页面
<head>
<script>
var intLeft = 2;
function returnPage(Url)
{
if (0 == intLeft)
{
window.location.href=Url;
}
else
{
intLeft -= 1;
setTimeout("returnPage('"+Url+"')", 2000);
}
}
</script>
</head>
<body onload="returnPage(‘b.aspx')">
</body>
<HEAD> <TITLE>刷新内容< /TITLE> <META HTTP-EQUIV="REFRESH" CONTENT="12; URL=12.aspx"> <!--12秒后跳转到12.aspx-->
< /HEAD>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document </title>
<meta http-equiv="Refresh" content="时间(单位为秒);URL=你想跳转的网址" />
</head>
<body>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<script>var dt=setInterval('redirect()',5000);document.write('页面将在5秒后跳转!');function redirect(){location.href='http://news.sina.com.cn/z/08earthquake/index.shtml';}</script>");
}
}