asp.net countdown automatic page jump method of USES javascript
- 2020-06-07 04:24:24
- OfStack
First, create a page to jump to, as follows.
<%@ 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> The jump page </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;">
Password changed successfully, please remember!
<br />
Automatic jump to system after seconds <a href="XXXXX/Home.aspx"> page </a>... And then there were <span id="time" style="font-weight:bold;color: blue">5</span> Seconds!
<br />
Or returns <a href="Login.aspx"> Landing page </a>...
</div>
</form>
</body>
</html>
Then type to the page we just created from the page you want to reference
Response.Redirect("LoginTiao.aspx");
Simple code, no mapping!