asp.net中倒计时自动跳转页面的实现方法(使用javascript)
首先,先建立一个用于跳转的页面,代码如下。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LoginTiao.aspx.cs" Inherits="LoginTiao" %>
<!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 id="Head1" runat="server">
<title>跳转页面</title>
<script type="text/javascript">
var i = 5;
window.onload=function page_cg()
{
document.getElementById("time").innerText = i;
i--;
if(i==0)
{
window.location.href("XXXXX/Home.aspx");
}
setTimeout(page_cg,1000);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="font-size:small;">
密码修改成功,请牢记!
<br />
秒后自动跳到系统<a href="XXXXX/Home.aspx">首页面</a>...还剩<span id="time" style="font-weight:bold;color: blue">5</span>秒!
<br />
或者返回<a href="Login.aspx">登陆页面</a>...
</div>
</form>
</body>
</html>
然后在要引用的页面打向我们刚刚建立的页面即可
Response.Redirect("LoginTiao.aspx");
代码简单就不贴图了!
相关文章
ASP.NET MVC4 利用uploadify.js多文件上传
本文主要介绍了ASP.NET MVC4利用uploadify.js实现多文件上传的方法代码。具有很好的参考价值。下面跟着小编一起来看下吧2017-03-03
如何在ASP.NET Core中使用ViewComponent
这篇文章主要介绍了如何在ASP.NET Core中使用ViewComponent,帮助大家更好的理解和学习使用.net技术,感兴趣的朋友可以了解下2021-04-04
asp.net CommunityServer中的wwwStatus
最近不得不对这个论坛进行研究,以适应后面的发展,现在同事研究太吃力了,以后改些东西,估计又要...打开web项目中的communityserver.config发现一个有趣的地方。2009-03-03
VS2017 Cordova Ionic2 移动开发环境搭建教程
这篇文章主要为大家详细介绍了VS2017 Cordova Ionic2 移动开发环境搭建教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-04-04


最新评论