Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Redirect to Another Page After 5 seconds or Some Time Delay in Asp.net

Oct 14, 2012
Introduction

Here I will explain how to redirect to another page after 5 seconds or some time delay in jQuery.

Description:
  
In previous articles I explained JavaScript redirect to another page after 5 seconds,
JQuery display Current Time on WebPage, Disable right click on image and many articles relating to JQuery and JavaScript. Now I will explain how to redirect to another page after 5 seconds or some time delay in jQuery.

To implement this functionality we need to write the following code


<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='http://www.aspdotnet-suresh.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>

Demo


Click Button to Redirect:




If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

8 comments :

Anonymous said...

hi sir i have a problem with visual studio 2008.at first i installed visual studio 2010 then i uninstalled it and again install vs 2008 now when i want to create new sql database the error genetared like

"this server virsion is not supported only server upto microsoft sql server 2005 is supported"

i also uninstall sql server 2008 from my computer but this error still come now what i have to ? please sir tell me its urgent

rams said...

Hi, Sir This is anji varikuti...one of your articles followers.Your articles were very fine and Useful for all programmers...can u please send me Jquery basic concepts....?

Waves Group said...
This comment has been removed by the author.
Manoj said...

Not all the time it is working... it works fine in IE. But try to run in firefox or chrome browser.
Try your code once again..

raj said...

sir i want to learn ajax completely.. can u plz help me

Suresh Dasari said...

@Manoj..
pls check your code I checked in all the browsers it's working perfectly.

Suresh Dasari said...

@raj...
Pls check the articles whatever I written for Ajax I explained all the articles.

malthane said...

By: Vijaykumar Malthane
Very nice script; working perfectly in my web pages.

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.