Automatic page timing (timing) jump in ASP.NET with JS

  • 2021-06-28 12:20:23
  • OfStack

ASP.NET implements page auto-jumping (tested and available in VS2008 C#environment)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
  <script type="text/javascript">
    var i = 5;
    //  Get login events and handle automatic jumps 
    window.onload = function JumpPage() 
      document.getElementById("time").innerText = i;
      //  Timed as 0 Jump immediately after 
      if (i < 0) 
      setTimeout("JumpPage()", 1000);
  <form id="form2" runat="server">
    <div id="AutoJumpPage">
       Welcome, this page will be <span id="time" style="color: #FF0000"></span> Automatically jump to after seconds <a href=""> Baidu </a>
      <br /><br />
       To jump now, tap directly  <a href="" style="color: #FF00FF"> Jump now >></a>

Related articles: