Results.Redirect(String, Boolean, Boolean) 方法

定義

重新導向至指定的 url

public static Microsoft.AspNetCore.Http.IResult Redirect (string url, bool permanent = false, bool preserveMethod = false);
static member Redirect : string * bool * bool -> Microsoft.AspNetCore.Http.IResult
Public Shared Function Redirect (url As String, Optional permanent As Boolean = false, Optional preserveMethod As Boolean = false) As IResult

參數

url
String

要重新導向的目的 URL。

permanent
Boolean

指定重新導向應永久 (301) 或暫時 (302) 。

preserveMethod
Boolean

如果設定為 true,請將暫時重新導向 (307) 或永久重新導向 (308) 保留初始要求方法。

傳回

為回應建立 IResult 的 。

適用於