HttpResponseWrapper.Redirect 方法

定义

将请求重定向到另一个 URL。Redirects a request to a different URL.

重载

Redirect(String)

将请求重定向到指定的 URL。Redirects a request to the specified URL.

Redirect(String, Boolean)

将请求重定向到指定的 URL,并指定是否应终止当前进程的执行。Redirects a request to the specified URL and specifies whether execution of the current process should terminate.

Redirect(String)

将请求重定向到指定的 URL。Redirects a request to the specified URL.

public:
 override void Redirect(System::String ^ url);
public override void Redirect (string url);
override this.Redirect : string -> unit
Public Overrides Sub Redirect (url As String)

参数

url
String

目标位置。The target location.

例外

发送 HTTP 标头之后尝试了重新定向。Redirection was attempted after the HTTP headers were sent.

适用于

Redirect(String, Boolean)

将请求重定向到指定的 URL,并指定是否应终止当前进程的执行。Redirects a request to the specified URL and specifies whether execution of the current process should terminate.

public:
 override void Redirect(System::String ^ url, bool endResponse);
public override void Redirect (string url, bool endResponse);
override this.Redirect : string * bool -> unit
Public Overrides Sub Redirect (url As String, endResponse As Boolean)

参数

url
String

目标位置。The target location.

endResponse
Boolean

如果为 true,则终止当前进程。true to terminate the current process.

例外

urlnullurl is null.

url 包含换行符。url contains a newline character.

发送 HTTP 标头之后尝试了重新定向。Redirection was attempted after the HTTP headers were sent.

请求是回调的结果。The request is the result of a callback.

适用于