How to Use Asp.net to Redirect HTM Files

ASP.NET is a proprietary web server side-scripting programming language by Microsoft. This programming language is typically used in conjunction with HTML to create database driven websites. ASP.NET is similar to PHP (an open source server side scripting language), but is more scalable and is typically used for larger enterprise applications. To redirect your Web pages using ASP.NET, you need to implement the Visual Basic "Response" syntax into your file.

Instructions

    • 1

      Click on the Windows "Start" button, "All Programs," "Accessories" and the "Notepad" shortcut icon. This will open Windows Notepad.

    • 2

      Click on "File" and "Open," then change the file type from "Text Documents" to "All Files." Locate your ASP.NET file, which should have the ".aspx" file extension, and double-click on it. The file will open in Notepad.

    • 3

      Copy the following syntax and paste it into your ASP.NET file:

      <script runat="server">

      private void Page_Load(object sender, System.EventArgs e)

      {

      Response.Status = "301 Moved Permanently";

      Response.AddHeader("Location","REPLACE_ME");

      }

      </script>

      Replace "REPLACE_ME" with the Internet location to which you want to redirect. For example, "http://www.demandmedia.com/about/index.html".

    • 4

      Press CTRL + S on your keyboard to save the file.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured