'Progress bar not redirecting to another page and not disappearing
There is a variation of threads on this topic but unfortunately none appears to address my issue.
Our progress bar is design to display when page loads and this progress bar is doing just that.
The issue is that after showing progress bar briefly, user is supposed to be redirected to another page called classes.aspx.
This is not happening. The progress bar does not disappear and does not redirect to another page.
Any ideas what I am missing?
Below is the exact code I am using.
//HTML
<%@ 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>Class 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>
<script type="text/javascript">
function ShowProgress() {
setTimeout(function () {
var modal = $('<div />');
modal.addClass("modal");
$('body').append(modal);
var loading = $(".loading");
loading.show();
var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
loading.css({ top: top, left: left });
}, 200);
}
$(window).load(function () {
ShowProgress();
});
</script>
<link rel="shortcut icon" href="~/images/favicon.ico" />
<style type="text/css">
.modal {
position:relative;
top:-1em;
z-index:100;
}
.loading{
font-family: Arial;
font-size: 10pt;
width: 200px;
height: 100px;
display: none;
position: fixed;
margin-top:400px;
margin-left: 0px;
background-color: White;
z-index: 999;
}
</style>
</head>
<body>
<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>
</body>
</html>
//VB
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Threading
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Public Class Main
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs)
Response.Redirect("classes.aspx")
End Sub
End Class
Thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
