Powered by Blogger.

Monday, February 24, 2014

Redirect users to different web site in Asp.Net using JavaScript




In this post we will discuss how to redirect users to different web sites in Asp.Net using JavaScript. Also you can check out my previous posts on:

- Get database server name in sql server 2008

- Virtual methods in C#.Net

- Difference between web application and web site in Asp.Net

In some situations you need to redirect users to different web site. In the below example whenever a user open the page, he will redirect to www.aspdotnethelp.com.

Below is the JavaScript code:
<head runat="server">
    <title>Redirect users to different web site in Asp.Net using JavaScript</title>
     <script type="text/javascript">
         location.replace("http://www.aspdotnethelp.com");
    </script>
</head>



0 comments

Post a Comment