Share via


Response.Redirect

The Redirect method causes the browser to attempt to connect to a different URL.

Syntax

Response.RedirectURL

Parameters
  • URL
    The Uniform Resource Locator that the browser is redirected to.
Remarks

Any response body content set explicitly in the page is ignored. However, this method does send other HTTP headers set by this page to the client. An automatic response body containing the redirect URL as a link is generated. The Redirect method sends the following explicit header, where URL is the value passed to the method, as shown in the following code:

  HTTP 1.0 302 Object Moved
Location URL
Example

The following example redirects the user to the Microsoft Web site:

  <% Response.Redirect "https://www.microsoft.com" %>

Applies To

Response Object