Platform SDK: IIS SDK

      [IIS 5.0] [IIS 5.1] [IIS 6.0]

Response.Redirect

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

Syntax

Response.Redirect URL

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 "http://www.microsoft.com" %>

For other than 302, see Response.Status

Applies To

Response Object

Requirements

Platforms: Windows 2000 with IIS 5.0 installed, Windows XP with IIS 5.1 installed, Windows Server 2003 family with IIS 6.0 installed

Platform SDK Release: February 2003
What did you think of this topic?
Order a Platform SDK CD