次の方法で共有


IResponse::Redirect

The IResponse::Redirect method first stops the server from processing the current script and then causes the browser to attempt to connect to a different URL. For more information, see the Response.Redirect method of the Response object.

HRESULT Redirect(
   BSTR bstrURL
);

Parameters

  • bstrURL
    [in] A BSTR that contains the URL.

Remarks

If you have set any response body content in the page, it will be ignored. However, this method does send to the client other HTTP headers set by this page. An automatic response body containing the redirect URL as a link is generated. The IResponse::Redirect method sends the following explicit header,

HTTP 1.0 302 Object Moved 
Location:  
URL 

where URL is the value passed to the method.

Note

If buffering is set to FALSE and your component attempts to call the Redirect method after any body has been sent to the client, the server will generate an error.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

See Also