RedirectResult 類別

定義

ActionResult 傳回 Found (302) 、已永久移動 (301) 、暫時重新導向 (307) ,或永久重新導向 (308) 回應,並將 Location 標頭傳送至提供的 URL。

public ref class RedirectResult : Microsoft::AspNetCore::Mvc::ActionResult, Microsoft::AspNetCore::Mvc::IActionResult, Microsoft::AspNetCore::Mvc::ViewFeatures::IKeepTempDataResult
public class RedirectResult : Microsoft.AspNetCore.Mvc.ActionResult, Microsoft.AspNetCore.Mvc.IActionResult, Microsoft.AspNetCore.Mvc.ViewFeatures.IKeepTempDataResult
type RedirectResult = class
    inherit ActionResult
    interface IKeepTempDataResult
    interface IActionResult
type RedirectResult = class
    inherit ActionResult
    interface IActionResult
    interface IKeepTempDataResult
Public Class RedirectResult
Inherits ActionResult
Implements IActionResult, IKeepTempDataResult
繼承
RedirectResult
實作

建構函式

RedirectResult(String)

使用提供的值,初始化 RedirectResult 類別的新執行個體。

RedirectResult(String, Boolean)

使用提供的值,初始化 RedirectResult 類別的新執行個體。

RedirectResult(String, Boolean, Boolean)

使用提供的值,初始化 RedirectResult 類別的新執行個體。

屬性

Permanent

取得或設定值,指定如果為 true 或為 false,則重新導向應該是永久的。

PreserveMethod

取得或設定重新導向會保留初始要求方法的指示。

Url

取得或設定要重新導向的 URL。

UrlHelper

取得或設定這個結果的 IUrlHelper

方法

ExecuteResult(ActionContext)
已淘汰.

同步執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

ExecuteResult(ActionContext)

同步執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

(繼承來源 ActionResult)
ExecuteResultAsync(ActionContext)

以非同步方式執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

ExecuteResultAsync(ActionContext)

以非同步方式執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。 此方法的預設實作會呼叫 ExecuteResult(ActionContext) 方法,並傳回已完成的工作。

(繼承來源 ActionResult)

適用於