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 Redirect method of the Response object.

HRESULT Redirect(

  BSTR bstrURL  // contains the URL

);

 

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.

See Also

Response Object