Home > ASP.Net, Jquery > JQuery Redirect to Another Page After Some Time Delay in Asp.net

JQuery Redirect to Another Page After Some Time Delay in Asp.net


Hi all,

Try this example to Use jQuery Redirect to Another Page after Some Time Delay in Asp.net

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JavaScript redirect to another page after 5 seconds or Sometime</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript">
var i = 0;
$(document).ready(function() {
ShowCurrentTime();
})
function ShowCurrentTime() {
var dt = new Date();
document.getElementById("lblTime").innerHTML = 5 - i + " Seconds";
i++;
if (i == 5) {
setTimeout("location.href='https://yasserzaid.wordpress.com'", 0);
}
window.setTimeout("ShowCurrentTime()", 1000);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
This Page will Redirec to Another Page within:
<label id="lblTime" style=" font-weight:bold; font-size:12pt"></label>
</div>
</form>
</body>
</html>

Hope this helps

Good Luck.

Advertisements
Categories: ASP.Net, Jquery
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: