How do i do a url redirect?

Discussion in 'Getting started' started by validian, Jun 23, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Bruce

    Bruce DiscountASP.NET Staff

    default.aspx is already a default document, you don't really have to create any redirect. If you put wsuswapmeet.com in your browser, IIS will automatically load default.aspx if it exists.
     
  2. Maybe you have a file named index.htm or something like that, and that's why the browser won't go to default.aspx.

    If that's your case you should set Default.aspx to be the default document on IIS in your hosting's control panel.

    But if you wish to make the redirect anyway, this code may help you:

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim url As String
    url = ("Default.aspx")
    Response.Redirect(url)

    End Sub
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page