您的位置:首页 > 编程语言 > ASP

asp.net倒计时自动跳转指定页面

2016-11-15 22:21 696 查看
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login_tiao.aspx.cs" Inherits="Login_tiao" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>跳转页面</title>

<script type="text/javascript">

var i = 3;//设置跳转的时间

window.onload = function page_cg() {

document.getElementById("time").innerText = i;

i--;

if (i == 0) {

window.location.href='xxxxx.aspx'//跳转到指定页面

}

setTimeout(page_cg, 1000);

}

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<br />

3秒后自动跳到用户信息页面<a href="xxxxx.aspx"></a>...还剩<span id="time" style="font-weight:bold;color: blue"></span>秒!

<br />

</div>

</form>

</body>
</html>



在你之间的Login.aspx.cs中加入

Response.Redirect("Login_tiao.aspx");跳转即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  asp.net