Hello again,
Sorry for another post. I tried resolving this on my own but having problem.
I followed some samples from aspsnippets forum but cannot get it to work.
A user opens up a browser and types for instance, http://myhomepage.com and hits enter, the page takes several seconds before redirecting to another page leading some users to think the page is not doing anything.
To resolve this, I borrowed a code from the site reference above so that a user would see a loading icon with message, Loading, please wait.
So far, the code is not working. The page still takes several seconds before redirecting without showing the loading message.
Any idea what could be missing?
As always, many thanks for your patience and continued assistance.
Partial Class Main
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim times As New Date
times = Now
If times < "01/01/2020 12:00:00 AM" Or times > "10/04/2020 11:59:00 PM" Then
Response.Redirect("done.aspx")
MyBase.OnLoad(e)
Else
Response.Redirect("contactlist.aspx")
End If
End Sub
End Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="Main" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Community Form</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge, IE=8, IE=9, IE=10, IE11,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="shortcut icon" href="~/images/favicon.ico" />
<link type="text/css" rel="stylesheet" href="css/loader.css" />
</head>
<body>
<img src="images/income1177DisclosureHeader.png" style="margin: auto;width:100%;" class="img-responsive" alt="" width="1177" height="168"/>
<form id="form1" runat="server">
<div class="loading" style="margin-top:100px;margin: auto;">
Loading. Please wait.<br />
<br />
<img src="images/loader.gif" alt="" />
</div>
</form>
<script type="text/javascript" src="js/progressbar.js"></script>
</body>
</html>