How to redirect one page to another page using javascript


How to redirect one page to another page using java script? In this article I'm going to explain how to redirect one page to another page using java script.

How to redirect one page to another page using java script? In this article I'm going to explain how to redirect one page to another page using java script. This is very simple code to redirect from one page to another page using java script at client side. You can show an appropriate message to your site visitors before redirecting to new web page. the following example implement the same.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript">
function Redirect()
{
window.location="http://www.dotnetspider.com";
}

document.write("You will be redirected to another page in 10 sec.");
setTimeout('Redirect()', 10000);
</script>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: